rpms/akmods/F-15 akmods, 1.4, 1.5 akmods.spec, 1.6, 1.7 akmodsbuild.1, 1.1, 1.2

Richard Shaw hobbes1069 at rpmfusion.org
Fri Sep 30 01:25:47 CEST 2011


Author: hobbes1069

Update of /cvs/free/rpms/akmods/F-15
In directory se02.es.rpmfusion.net:/tmp/cvs-serv30257

Modified Files:
	akmods akmods.spec akmodsbuild.1 
Log Message:
* Fri Sep 23 2011 Richard Shaw <hobbes1069 at gmail.com> - 0.3.7-1
- Update to 0.3.7
- Fixes #1805. Version check is now properly based on rpmdev-vercmp exit code.
- Fixes #1813. Exit code is now 0 on success for systemd compatability.
- Fixes #485. Change from "lockfile" to "flock" for lockfile management to
  remove dependency on procmail.
- Fixes #773. Added /usr/bin/time as a requirement.
- Fixes #1592.
- Fixes #1930. "/var/cache/akmods" is now owned by the akmods user. 



Index: akmods
===================================================================
RCS file: /cvs/free/rpms/akmods/F-15/akmods,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- akmods	1 Feb 2009 13:21:31 -0000	1.4
+++ akmods	29 Sep 2011 23:25:46 -0000	1.5
@@ -36,7 +36,7 @@
 
 # global vars
 myprog="akmods"
-myver="0.3.5"
+myver="0.3.7"
 kmodlogfile=
 continue_line=""
 tmpdir=
@@ -105,7 +105,7 @@
 
 	exit ${1:-128}
 }
-trap "finally" ABRT EXIT HUP INT QUIT
+trap "finally" ABRT HUP INT QUIT
 
 create_tmpdir()
 {
@@ -192,7 +192,7 @@
 	fi
 
 	# tools needed
-	for tool in akmodsbuild chown lockfile sed rpmdev-vercmp; do
+	for tool in akmodsbuild chown flock sed rpmdev-vercmp; do
 		if ! which "${tool}" &> /dev/null ; then
 			echo -n "${tool} not found" >&2
 			echo_failure; echo; exit 1
@@ -200,7 +200,8 @@
 	done
 
 	# create lockfile and wait till we get it
-	lockfile -s 2 -l 1800 "/var/cache/akmods/.lockfile"
+	exec 99>/var/lock/subsys/akmods
+	flock -w 900 99
 }
 
 buildinstall_kmod()
@@ -277,15 +278,15 @@
 
 	# everything fine?
 	if (( ${returncode} != 0 )); then
-			if [[ "${continue_line}" ]]; then
-				akmods_echo 1 2 --failure
-			fi
-			akmods_echo 2 1 "Could not install newly built RPMs. You can find them and the logfile"
-			akmods_echo 2 1 "${this_kmodverrel}-for-${this_kernelver}.failed.log in /var/cache/akmods/${this_kmodname}/"
-			cp -fl "${kmodlogfile}" "/var/cache/akmods/${this_kmodname}/${this_kmodverrel}-for-${this_kernelver}.failed.log"
-			kmodlogfile=""
-			remove_tmpdir
-			return 8
+		if [[ "${continue_line}" ]]; then
+			akmods_echo 1 2 --failure
+		fi
+		akmods_echo 2 1 "Could not install newly built RPMs. You can find them and the logfile"
+		akmods_echo 2 1 "${this_kmodverrel}-for-${this_kernelver}.failed.log in /var/cache/akmods/${this_kmodname}/"
+		cp -fl "${kmodlogfile}" "/var/cache/akmods/${this_kmodname}/${this_kmodverrel}-for-${this_kernelver}.failed.log"
+		kmodlogfile=""
+		remove_tmpdir
+		return 8
 	fi
 
 	# finish
@@ -319,21 +320,21 @@
 	local kmodver=$(rpm -q --qf '%{EPOCH}:%{VERSION}-%{RELEASE}\n' "${kmodpackage}" | sed 's|(none)|0|; s!\.\(fc\|lvn\)[0-9]*!!g')
 	local akmodver=$(rpm -qp --qf '%{EPOCH}:%{VERSION}-%{RELEASE}\n' /usr/src/akmods/"${this_kmodname}"-kmod.latest | sed 's|(none)|0|; s!\.\(fc\|lvn\)[0-9]*!!g')
 
-	# are they equal?
-	if [[ "${kmodver}" == "${akmodver}" ]]; then
+	rpmdev-vercmp "${kmodver}" "${akmodver}" &>/dev/null
+	if [ "$?" == 0 ]; then
+		# Versions are the same. Nothing to do.
 		return 0
-	fi
-	
-	local newestpkgver=$(rpmdev-vercmp "${kmodver}" "${akmodver}" 2>/dev/null | awk '{print $1}')
-	if [[ ! "${kmodver}" ]] || [[ ! "${akmodver}" ]] || [[ ! "${newestpkgver}" ]] ; then
-		# seems we didn't get what we wanted
-		# well, better to do nothing in this case
-		akmods_echo 1 2 -n "Warning: Could not determine if akmod is newer then the installed kmod"
+	elif [ "$?" == 11 ]; then
+		# kmod is newer, this nomally shouldn't happen.
+		akmods_echo 1 2 -n "Warning: installed kmod is newer then the akmod"
 		return 0
-	elif [[ "${akmodver}" == "${newestpkgver}" ]] ; then
-		# build it
+	elif [ "$?" == 12 ]; then
+		# akmod is newer, need to build kmod.
 		return 1
 	else
+		# Something went wrong
+		akmods_echo 1 2 -n "Error: Could not determine if akmod is newer then the installed kmod"
+		akmods_echo 1 2 --failure
 		return 0
 	fi
 }
@@ -362,7 +363,8 @@
 			if [[ "${continue_line}" ]]; then
 				akmods_echo 1 2 --success 
 				# if the files for building modules are not avilable don't even try to build modules
-				if [[ ! -r /usr/src/kernels/"${this_kernelver}"/Makefile ]] || [[ ! -r  /lib/modules/${this_kernelver}/build/Makefile ]]; then
+				if [[ ! -r /usr/src/kernels/"${this_kernelver}"/Makefile ]] && \
+				   [[ ! -r /lib/modules/${this_kernelver}/build/Makefile ]]; then
 					akmods_echo 1 2 "Files needed for building modules against kernel"
 					akmods_echo 1 2 "${this_kernelver} could not be found as the following" 
 					akmods_echo 1 2 "directories are missing:" 
@@ -421,10 +423,12 @@
 			if [[ ! "${1}" ]] ; then
 				echo "ERROR: Please provide the kernel-version to build for together with --kernel" >&2
 				exit 1
-			elif [[ ! -r /usr/src/kernels/"${1}"/Makefile ]] && [[ ! -r /lib/modules/${1}/build/Makefile ]]; then
+			elif [[ ! -r /usr/src/kernels/"${1}"/Makefile ]] && \
+			     [[ ! -r /lib/modules/${1}/build/Makefile ]]; then
 				echo "Could not find files needed to compile modules for ${1}"
 				exit 1
-			elif [[ -r /usr/src/kernels/"${1}"/Makefile ]] && [[ ! -r /boot/vmlinuz-"${1}" ]]; then
+			elif [[ -r /usr/src/kernels/"${1}"/Makefile ]] && \
+			     [[ ! -r /boot/vmlinuz-"${1}" ]]; then
 				# this is a red hat / fedora kernel-devel package, but the kernel for it is not installed
 				# kmodtool would adds a dep on that kernel when building; thus when we'd try to install the 
 				# rpms we'd run into a missing-dep problem. Thus we prevent that case
@@ -457,7 +461,7 @@
 			shift
 			;;
 		--from-init)
-			# just in case: remove stale lockfile is it exists:
+			# just in case: remove stale lockfile if it exists:
 			rm -f /var/cache/akmods/.lockfile
 			shift
 			;;
@@ -494,7 +498,7 @@
 
 # go
 for kernel in ${kernels} ; do
-		check_kmods ${kernel}
+	check_kmods ${kernel}
 done
 
 # finished :)


Index: akmods.spec
===================================================================
RCS file: /cvs/free/rpms/akmods/F-15/akmods.spec,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- akmods.spec	2 Aug 2009 13:43:08 -0000	1.6
+++ akmods.spec	29 Sep 2011 23:25:46 -0000	1.7
@@ -1,24 +1,25 @@
 Name:           akmods
-Version:        0.3.6
-Release:        3%{?dist}
+Version:        0.3.7
+Release:        1%{?dist}
 Summary:        Automatic kmods build and install tool 
 
 Group:          System Environment/Kernel
 License:        MIT
 URL:            http://rpmfusion.org/Packaging/KernelModules/Akmods
 Source0:        akmods
-#to be written: Source1:        akmods.1
+# To be written
+#Source1:        akmods.1
 Source2:        akmodsbuild
 Source3:        akmodsbuild.1
 Source4:        akmodsinit
 Source6:        akmodsposttrans
-BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildArch:      noarch
 
 # not picked up automatically
 Requires:       %{_bindir}/nohup
-Requires:       %{_bindir}/lockfile
+Requires:       %{_bindir}/flock
+Requires:       %{_bindir}/time
 
 # needed for actually building kmods:
 Requires:       %{_bindir}/rpmdev-vercmp
@@ -57,19 +58,15 @@
 
 
 %install
-rm -rf $RPM_BUILD_ROOT
-mkdir -p \
-   $RPM_BUILD_ROOT/%{_usrsrc}/akmods/ \
-   $RPM_BUILD_ROOT/%{_localstatedir}/cache/akmods/
-install -D -p -m 0755 %{SOURCE0} $RPM_BUILD_ROOT/%{_sbindir}/akmods
-install -D -p -m 0755 %{SOURCE2} $RPM_BUILD_ROOT/%{_bindir}/akmodsbuild
-install -D -p -m 0644 %{SOURCE3} ${RPM_BUILD_ROOT}%{_mandir}/man1/akmodsbuild.1
-install -D -p -m 0755 %{SOURCE4} $RPM_BUILD_ROOT/%{_initrddir}/akmods
+mkdir -p %{buildroot}%{_usrsrc}/akmods/ \
+         %{buildroot}%{_localstatedir}/cache/akmods/
+install -D -p -m 0755 %{SOURCE0} %{buildroot}%{_sbindir}/akmods
+install -D -p -m 0755 %{SOURCE2} %{buildroot}%{_bindir}/akmodsbuild
+install -D -p -m 0644 %{SOURCE3} %{buildroot}%{_mandir}/man1/akmodsbuild.1
+install -D -p -m 0755 %{SOURCE4} %{buildroot}%{_initrddir}/akmods
 # %%{_sysconfdir}/kernel/posttrans.d/ should be owned my mkinitrd #441111
-install -D -p -m 0755 %{SOURCE6} $RPM_BUILD_ROOT/%{_sysconfdir}/kernel/postinst.d/akmods
+install -D -p -m 0755 %{SOURCE6} %{buildroot}/%{_sysconfdir}/kernel/postinst.d/akmods
 
-%clean
-rm -rf $RPM_BUILD_ROOT
 
 %pre
 # create group and user
@@ -94,16 +91,26 @@
 
 
 %files 
-%defattr(-,root,root,-)
 %{_usrsrc}/akmods
-%{_localstatedir}/cache/akmods/
+%attr(-,akmods,akmods) %{_localstatedir}/cache/akmods
 %{_bindir}/akmodsbuild
 %{_sbindir}/akmods
 %{_initrddir}/akmods
 %{_sysconfdir}/kernel/postinst.d/akmods
 %{_mandir}/man1/*
 
+
 %changelog
+* Fri Sep 23 2011 Richard Shaw <hobbes1069 at gmail.com> - 0.3.7-1
+- Update to 0.3.7
+- Fixes #1805. Version check is now properly based on rpmdev-vercmp exit code.
+- Fixes #1813. Exit code is now 0 on success for systemd compatability.
+- Fixes #485. Change from "lockfile" to "flock" for lockfile management to
+  remove dependency on procmail.
+- Fixes #773. Added /usr/bin/time as a requirement.
+- Fixes #1592.
+- Fixes #1930. "/var/cache/akmods" is now owned by the akmods user. 
+
 * Sun Aug 02 2009 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info> - 0.3.6-3
 - add lockfile as hard dep
 


Index: akmodsbuild.1
===================================================================
RCS file: /cvs/free/rpms/akmods/F-15/akmodsbuild.1,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- akmodsbuild.1	2 Oct 2008 17:28:11 -0000	1.1
+++ akmodsbuild.1	29 Sep 2011 23:25:46 -0000	1.2
@@ -17,8 +17,8 @@
 .PP
 .nf
 .fam C
-   Build the kmod for kernels in list; try to build for the current kernel
-   (e.g. output from 'uname -r') if option is not used.
+   Build the kmod for kernels in list; try to build for the current
+   kernel (e.g. output from 'uname -r') if option is not used.
 
 .fam T
 .fi
@@ -82,9 +82,11 @@
 .PP
 .nf
 .fam C
-      $ akmodsbuild /usr/src/akmods/ndiswrapper-kmod-1.52-1.lvn9.1.src.rpm /usr/src/akmods/madwifi-kmod-0.9.4-2.lvn9.src.rpm
+$ akmodsbuild /usr/src/akmods/ndiswrapper-kmod-1.52-1.lvn9.1.src.rpm /usr/src/akmods/madwifi-kmod-0.9.4-2.lvn9.src.rpm
 
 .SH BUGS
-None know, but there are likely some
+https://bugzilla.rpmfusion.org/buglist.cgi?product=Fedora&component=akmods&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED
 .SH AUTHOR
 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info>
+.SH MAINTAINER
+Richard Shaw <hobbes1069 [AT] gmail [DOT] com>



More information about the rpmfusion-commits mailing list