[bash-argsparse] 1.6.1-2: Initial import #1129220

Damien Nadé anvil at fedoraproject.org
Thu Oct 23 17:28:58 UTC 2014


commit 7888b005558863830d9edd442f6531e1fef7e147
Author: Damien Nadé <anvil at livna.org>
Date:   Thu Oct 23 19:28:45 2014 +0200

    1.6.1-2: Initial import #1129220

 .gitignore                          |    1 +
 bash-argsparse-1.6.1-unittest.patch |   47 ++++++++++++++++++++
 bash-argsparse.spec                 |   83 +++++++++++++++++++++++++++++++++++
 sources                             |    1 +
 4 files changed, 132 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..7797416 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/bash-argsparse-1.6.1.tar.gz
diff --git a/bash-argsparse-1.6.1-unittest.patch b/bash-argsparse-1.6.1-unittest.patch
new file mode 100644
index 0000000..0fb76fa
--- /dev/null
+++ b/bash-argsparse-1.6.1-unittest.patch
@@ -0,0 +1,47 @@
+diff --git a/unittest b/unittest
+index f3c2f0e..1b6371f 100755
+--- a/unittest
++++ b/unittest
+@@ -261,7 +261,7 @@ dir=$(mktemp -d)
+ file=$(mktemp --tmpdir="$dir")
+ declare -A types=(
+ 	[link]="$dir/link1 $dir/link2"
+-	[file]="$file ${types[link]}"
++	[file]="$file $dir/link1"
+ 	[directory]=". .. $dir $dir/linkdir"
+ 	[char]="c . 0 @"
+ 	[unsignedint]=123
+@@ -269,7 +269,6 @@ declare -A types=(
+ 	[hexa]="0x123abc 71234 abc"
+ 	[ipv4]="192.168.40.254 127.0.0.1 1.2.3.4"
+ 	[ipv6]="2001:7a8:b018::1 ::1 2001:7a8:b018:0:21f:c6ff:fe59:71fd"
+-	[host]="${types[ipv4]} ${types[ipv6]}"
+ 	[username]=$(whoami)
+ 	[group]=$(id -gn)
+ 	[port]="ssh 80"
+@@ -307,6 +306,8 @@ do
+ 	fi
+ done
+ 
++# Default 'host' type test case:
++types[host]="${types[ipv4]} ${types[ipv6]}"
+ # Test hostnames only if we can actually resolv.
+ if host localhost >/dev/null 2>&1
+ then
+@@ -318,6 +319,7 @@ else
+ fi
+ 
+ (cd "$dir" && ln -s "$file" link1 && ln -s asdf link2 && ln -s . linkdir)
++
+ for type in "${!types[@]}"
+ do
+ 	(
+@@ -337,7 +339,7 @@ declare -A bad_types=(
+ 	[directory]="${types[file]} $fifo $dir/link1"
+ 	[pipe]="${types[file]} ${types[dir]}"
+ 	[socket]="${types[file]} $fifo $dir/link1"
+-	[link]="${types[file]} $fifo"
++	[link]="$file $fifo"
+ 	[char]="12 abc"
+ 	[unsignedint]="-1 -2234958 abc"
+ 	[int]="a b casdf"
diff --git a/bash-argsparse.spec b/bash-argsparse.spec
new file mode 100644
index 0000000..8f2ccdd
--- /dev/null
+++ b/bash-argsparse.spec
@@ -0,0 +1,83 @@
+Summary: An high level argument parsing library for bash
+Name: bash-argsparse
+Version: 1.6.1
+Release: 2%{?dist}
+License: WTFPL
+URL: https://github.com/Anvil/bash-argsparse
+Source0: http://argsparse.livna.org/%{name}-%{version}.tar.gz
+Patch1: bash-argsparse-1.6.1-unittest.patch
+BuildArch: noarch
+# Binaries are required for unittest to perform cleanly.
+BuildRequires: doxygen /bin/getopt /bin/getent /usr/bin/host
+
+Requires: bash >= 4.1
+Requires: /bin/getopt /bin/getent /usr/bin/host
+
+%description
+An high level argument parsing library for bash.
+
+The purpose is to replace the option-parsing and usage-describing
+functions commonly rewritten in all scripts.
+
+This library is implemented for bash version 4. Prior versions of bash
+will fail at interpreting that code.
+
+%prep
+%setup -q
+%patch1 -p1
+
+%build
+# Nothing to build, except the documentation.
+doxygen
+
+%install
+mkdir -p $RPM_BUILD_ROOT/%{_bindir}
+install -m 0755 argsparse.sh $RPM_BUILD_ROOT/%{_bindir}
+ln -s argsparse.sh $RPM_BUILD_ROOT/%{_bindir}/argsparse
+
+%check
+./unittest
+
+%files
+%doc tutorial README.md html COPYING
+%{_bindir}/argsparse
+%{_bindir}/argsparse.sh
+
+
+%changelog
+* Wed Oct 15 2014 Dams <bash-argsparse[AT]livna.org> - 1.6.1-2
+- Added patch to fix some unittest issues
+
+* Thu Oct  9 2014 Dams <bash-argsparse[AT]livna.org> - 1.6.1-1
+- Version 1.6.1
+- Fixed changelog names
+
+* Thu Oct  9 2014 Dams <bash-argsparse[AT]livna.org> - 1.6-4
+- Update host path in *Requires tags.
+
+* Wed Oct 8 2014 Dams <bash-argsparse[AT]livna.org> - 1.6-3
+- Added more BuildRequires to allow unittest script to run correctly
+  restricted small environments
+
+* Mon Sep 15 2014 Dams <bash-argsparse[AT]livna.org> - 1.6-2
+- Fixed date in changelog entry
+
+* Tue Aug 12 2014 Dams <bash-argsparse[AT]livna.org> - 1.6-1
+- License tag is now WTFPL
+- Removed trailing dot at the end of Summary
+- Removed BuildRoot tag
+- Requiring commands instead of packages
+
+* Mon Jan 13 2014 Dams <bash-argsparse[AT]livna.org> - 1.6-0
+- Version 1.6
+- Added doxygen documentation
+- check section
+
+* Thu Mar 21 2013 Dams <bash-argsparse[AT]livna.org> - 1.5-0
+- Version 1.5
+- Updated Requires
+- Removed old/fedora-obsolete directives/noise
+
+* Thu Mar 14 2013 Dams <bash-argsparse[AT]livna.org> - 1.4-0
+- Initial build.
+
diff --git a/sources b/sources
index e69de29..3b98f87 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+90c882ef7473a0f8f7f8f6a0d77a081d  bash-argsparse-1.6.1.tar.gz


More information about the scm-commits mailing list