432fa2
# Where lock files are stored
432fa2
%global _lockdir /run/lock/lockdev
432fa2
432fa2
%global checkout 20111007git
432fa2
%global co_date  2011-10-07
432fa2
432fa2
#http://lists.fedoraproject.org/pipermail/devel/2011-August/155358.html
432fa2
%global _hardened_build 1
432fa2
432fa2
Summary: A library for locking devices
432fa2
Name: lockdev
432fa2
Version: 1.0.4
432fa2
Release: 0.28.%{checkout}%{?dist}
432fa2
License: LGPLv2
432fa2
Group: System Environment/Libraries
432fa2
URL: https://alioth.debian.org/projects/lockdev/
432fa2
432fa2
# This is a nightly snapshot downloaded via
432fa2
# https://alioth.debian.org/snapshots.php?group_id=100443
432fa2
Source0: lockdev-%{version}.%{checkout}.tar.gz
432fa2
432fa2
Patch1: lockdev-euidaccess.patch
432fa2
Patch2: 0001-major-and-minor-functions-moved-to-sysmacros.h.patch
432fa2
Patch3: 0001-Fix-manpages-NAME-section.patch
432fa2
432fa2
Requires(pre): shadow-utils
432fa2
Requires(post): glibc
432fa2
Requires(postun): glibc
432fa2
Requires: systemd
432fa2
432fa2
BuildRequires: autoconf
432fa2
BuildRequires: automake
432fa2
BuildRequires: libtool
432fa2
BuildRequires: perl-interpreter
432fa2
BuildRequires: perl(ExtUtils::MakeMaker)
432fa2
BuildRequires: systemd
432fa2
432fa2
%description
432fa2
Lockdev provides a reliable way to put an exclusive lock to devices
432fa2
using both FSSTND and SVr4 methods.
432fa2
432fa2
%package devel
432fa2
Summary: The header files for the lockdev library
432fa2
Group: System Environment/Libraries
432fa2
Requires: lockdev = %{version}-%{release}
432fa2
432fa2
%description devel
432fa2
The lockdev library provides a reliable way to put an exclusive lock
432fa2
on devices using both FSSTND and SVr4 methods. The lockdev-devel
432fa2
package contains the development headers.
432fa2
432fa2
432fa2
%prep
432fa2
%setup -q -n lockdev-scm-%{co_date}
432fa2
432fa2
# Replace access() calls with euidaccess() (600636#c33)
432fa2
%patch1 -p1 -b .access
432fa2
%patch2 -p1
432fa2
%patch3 -p1
432fa2
432fa2
%build
432fa2
# Generate version information from git release tag
432fa2
./scripts/git-version > VERSION
432fa2
432fa2
# To satisfy automake
432fa2
touch ChangeLog
432fa2
432fa2
# Bootstrap autotools
432fa2
autoreconf --verbose --force --install
432fa2
432fa2
CFLAGS="%{optflags} -D_PATH_LOCK=\\\"%{_lockdir}\\\"" \
432fa2
%configure --disable-static --enable-helper --disable-silent-rules
432fa2
432fa2
make %{?_smp_mflags}
432fa2
432fa2
%install
432fa2
make install DESTDIR=%{buildroot}
432fa2
432fa2
rm -f %{buildroot}%{_libdir}/*.la
432fa2
432fa2
# %%ghosted, but needs to be in buildroot
432fa2
# on reboot re-created by %%{_prefix}/lib/tmpfiles.d/legacy.conf
432fa2
mkdir -p %{buildroot}%{_lockdir}
432fa2
432fa2
# install /usr/lib/tmpfiles.d/lockdev.conf (#1324184)
432fa2
mkdir -p ${RPM_BUILD_ROOT}%{_tmpfilesdir}
432fa2
cat > ${RPM_BUILD_ROOT}%{_tmpfilesdir}/lockdev.conf <
432fa2
# See tmpfiles.d(5) for details
432fa2
432fa2
d %{_lockdir} 0775 root lock -
432fa2
EOF
432fa2
432fa2
%pre
432fa2
getent group lock >/dev/null 2>&1 || groupadd -g 54 -r -f lock >/dev/null 2>&1 || :
432fa2
432fa2
%post
432fa2
/sbin/ldconfig
432fa2
if [ $1 -eq 1 ] ; then
432fa2
# for the time until first reboot
432fa2
%tmpfiles_create
432fa2
fi
432fa2
432fa2
%postun -p /sbin/ldconfig
432fa2
432fa2
432fa2
%files
432fa2
%{license} COPYING
432fa2
%doc AUTHORS
432fa2
%ghost %dir %attr(0775,root,lock) %{_lockdir}
432fa2
%attr(2711,root,lock)  %{_sbindir}/lockdev
432fa2
%{_tmpfilesdir}/lockdev.conf
432fa2
%{_libdir}/*.so.*
432fa2
%{_mandir}/man8/*
432fa2
432fa2
%files devel
432fa2
%{_libdir}/*.so
432fa2
%{_libdir}/pkgconfig/lockdev.pc
432fa2
%{_mandir}/man3/*
432fa2
%{_includedir}/*
432fa2
432fa2
%changelog
432fa2
* Mon Aug 06 2018 Sebastian Kisela <skisela@redhat.com> - 1.0.4-0.28.
432fa2
- Fix man page wording to pass errors detected by lexgrog.
432fa2
Fixes: 1612764
432fa2
432fa2
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.4-0.27.20111007git
432fa2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
432fa2
- Explicitly include <sys/sysmacros.h> due to glibc-headers changes.
432fa2
Definition of major and minor macros is no longer transitively included
432fa2
through <sys/types.h>, hence make it explicit.
432fa2
Ref:
432fa2
https://sourceware.org/git/?p=glibc.git;a=blob_plain;f=NEWS;hb=HEAD
432fa2
432fa2
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.4-0.26.20111007git
432fa2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
432fa2
432fa2
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.4-0.25.20111007git
432fa2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
432fa2
432fa2
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.4-0.24.20111007git
432fa2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
432fa2
432fa2
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.4-0.23.20111007git
432fa2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
432fa2
432fa2
* Wed Apr 06 2016 Jiri Popelka <jpopelka@redhat.com> - 1.0.4-0.22.20111007git
432fa2
- /run/lock/lockdev no longer created by systemd (#1324184)
432fa2
432fa2
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.4-0.21.20111007git
432fa2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
432fa2
432fa2
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.4-0.20.20111007git
432fa2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
432fa2
432fa2
* Mon Nov 03 2014 Jiri Popelka <jpopelka@redhat.com> - 1.0.4-0.19.20111007git
432fa2
- change _lockdir from /var/lock/lockdev to /run/lock/lockdev
432fa2
432fa2
* Thu Sep 18 2014 Jiri Popelka <jpopelka@redhat.com> - 1.0.4-0.18.20111007git
432fa2
- better euidaccess.patch from Paolo Bonzini (#600636#c33)
432fa2
432fa2
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.4-0.17.20111007git
432fa2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
432fa2
432fa2
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.4-0.16.20111007git
432fa2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
432fa2
432fa2
* Sat Dec 21 2013 Ville Skyttä <ville.skytta@iki.fi> - 1.0.4-0.15.20111007git
432fa2
- BuildRequire systemd for %%tmpfiles_create.
432fa2
432fa2
* Thu Dec 05 2013 Jiri Popelka <jpopelka@redhat.com> - 1.0.4-0.14.20111007git
432fa2
- Define _GNU_SOURCE in lockdev.c
432fa2
432fa2
* Thu Nov 28 2013 Jiri Popelka <jpopelka@redhat.com> - 1.0.4-0.13.20111007git
432fa2
- revert previous change and use %%tmpfiles_create in %%post
432fa2
432fa2
* Wed Nov 27 2013 Jiri Popelka <jpopelka@redhat.com> - 1.0.4-0.12.20111007git
432fa2
- do not %%ghost /var/lock/lockdev (https://fedorahosted.org/fesco/ticket/525)
432fa2
432fa2
* Mon Aug 26 2013 Jiri Popelka <jpopelka@redhat.com> - 1.0.4-0.11.20111007git
432fa2
- Remove the %%post scriptlet completely (#983772)
432fa2
432fa2
* Mon Aug 26 2013 Jiri Popelka <jpopelka@redhat.com> - 1.0.4-0.10.20111007git
432fa2
- Silence possible %%post scriptlet errors (#983772)
432fa2
432fa2
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.4-0.9.20111007git
432fa2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
432fa2
432fa2
* Fri Jul 12 2013 Jiri Popelka <jpopelka@redhat.com> - 1.0.4-0.8.20111007git
432fa2
- %%{_lockdir} is %%ghost-ed (#983772)
432fa2
432fa2
* Mon Jun 03 2013 Jiri Popelka <jpopelka@redhat.com> - 1.0.4-0.7.20111007git
432fa2
- Replace access() calls with euidaccess(), build with -D_GNU_SOURCE (600636#c9)
432fa2
432fa2
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.4-0.6.20111007git
432fa2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
432fa2
432fa2
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.4-0.5.20111007git
432fa2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
432fa2
432fa2
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.4-0.4.20111007git
432fa2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
432fa2
432fa2
* Thu Oct 20 2011 Jiri Popelka <jpopelka@redhat.com> - 1.0.4-0.3.20111007git
432fa2
- Define _hardened_build
432fa2
432fa2
* Wed Oct 19 2011 Jiri Popelka <jpopelka@redhat.com> - 1.0.4-0.2.20111007git
432fa2
- Fixed URL
432fa2
- Removed unused patches
432fa2
432fa2
* Fri Oct 07 2011 Jiri Popelka <jpopelka@redhat.com> - 1.0.4-0.1.20111007git
432fa2
- pre 1.0.4 nightly snapshot
432fa2
432fa2
* Mon Apr 04 2011 Jiri Popelka <jpopelka@redhat.com> - 1.0.3-10
432fa2
- Revert previous change (#681898)
432fa2
- /etc/tmpfiles.d/lockdev.conf moved into systemd upstream (#692714)
432fa2
432fa2
* Thu Mar 03 2011 Jan Görig <jgorig@redhat.com> - 1.0.3-9
432fa2
- Change /var/lock/lockdev permissions to 1777 (#681898)
432fa2
432fa2
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.3-8
432fa2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
432fa2
432fa2
* Thu Nov 25 2010 Jiri Popelka <jpopelka@redhat.com> - 1.0.3-7
432fa2
- Fixed some rpmlint warnings
432fa2
432fa2
* Thu Nov 25 2010 Jiri Popelka <jpopelka@redhat.com> - 1.0.3-6
432fa2
- Added /etc/tmpfiles.d/lockdev.conf to enable lock directory on tmpfs (#656614)
432fa2
- Don't ship static library at all
432fa2
432fa2
* Mon Apr 19 2010 Jiri Popelka <jpopelka@redhat.com> - 1.0.3-5
432fa2
- Changed directory for lock files from /var/lock to /var/lock/lockdev (#581884)
432fa2
432fa2
* Thu Jan 21 2010 Jiri Popelka <jpopelka@redhat.com> - 1.0.3-4
432fa2
- Created -static subpackage to ship static library separately
432fa2
- Updated lockdev.8 manpage
432fa2
432fa2
* Thu Dec 10 2009 Jiri Popelka <jpopelka@redhat.com> - 1.0.3-3
432fa2
- Correct rh.patch
432fa2
432fa2
* Thu Dec 10 2009 Jiri Popelka <jpopelka@redhat.com> - 1.0.3-2
432fa2
- Correct rh.patch
432fa2
432fa2
* Mon Dec 07 2009 Jiri Popelka <jpopelka@redhat.com> - 1.0.3-1
432fa2
- 1.0.3.  No longer need 1.0.0-signal, 1.0.1-subdir, 1.0.1-fcntl, 1.0.1-32bit patches.
432fa2
- Renumbered patches and sources.
432fa2
432fa2
* Thu Dec 03 2009 Jiri Popelka <jpopelka@redhat.com> - 1.0.1-20
432fa2
- Fixed pre section (http://fedoraproject.org/wiki/Packaging/UsersAndGroups)
432fa2
- Added back Buildroot to silence rpmlint's false positive
432fa2
432fa2
* Tue Dec 01 2009 Jiri Popelka <jpopelka@redhat.com> - 1.0.1-19
432fa2
- Added license text to package
432fa2
432fa2
* Fri Oct 02 2009 Jiri Popelka <jpopelka@redhat.com> - 1.0.1-18
432fa2
- Fixed mixed-use-of-spaces-and-tabs
432fa2
432fa2
* Fri Oct 02 2009 Jiri Popelka <jpopelka@redhat.com> - 1.0.1-17
432fa2
- Removed PreReq tag
432fa2
432fa2
* Fri Sep 25 2009 Jiri Popelka <jpopelka@redhat.com> - 1.0.1-16
432fa2
- Manual page for /usr/sbin/lockdev
432fa2
432fa2
* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.1-15
432fa2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
432fa2
432fa2
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.1-14
432fa2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
432fa2
432fa2
* Mon Oct  6 2008 Karel Zak <kzak@redhat.com> - 1.0.1-13
432fa2
- refresh patches (due --fuzz=0)
432fa2
- fix compiler warnings
432fa2
432fa2
* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 1.0.1-12.1
432fa2
- Autorebuild for GCC 4.3
432fa2
432fa2
* Mon Oct 15 2007 Tom "spot" Callaway <tcallawa@redhat.com> - 1.0.1-11.1
432fa2
- correct license tag
432fa2
- add BR: perl(ExtUtils::MakeMaker)
432fa2
432fa2
* Thu Apr 12 2007 Karel Zak <kzak@redhat.com> - 1.0.1-11
432fa2
- fix rpmlint issues
432fa2
- change lockdev permissions from 2755 to 2711
432fa2
432fa2
* Wed Jul 19 2006 Karel Zak <kzak@redhat.com> - 1.0.1-10
432fa2
- rebuild
432fa2
432fa2
* Wed Jul 12 2006 Jesse Keating <jkeating@redhat.com> - 1.0.1-9.2.2
432fa2
- rebuild
432fa2
432fa2
* Fri Feb 10 2006 Jesse Keating <jkeating@redhat.com> - 1.0.1-9.2.1
432fa2
- bump again for double-long bug on ppc(64)
432fa2
432fa2
* Tue Feb 07 2006 Jesse Keating <jkeating@redhat.com> - 1.0.1-9.2
432fa2
- rebuilt for new gcc4.1 snapshot and glibc changes
432fa2
432fa2
* Fri Dec 09 2005 Jesse Keating <jkeating@redhat.com>
432fa2
- rebuilt
432fa2
432fa2
* Wed Sep 21 2005 Karel Zak <kzak@redhat.com> 1.0.1-9
432fa2
- fix #165189 - The naming of the lock file by the lockdev command is abnormal.
432fa2
432fa2
* Thu Sep  1 2005 Karel Zak <kzak@redhat.com> 1.0.1-8
432fa2
- fix #163276 - baudboy.h should include fcntl.h
432fa2
432fa2
* Sat Mar  5 2005 Karel Zak <kzak@redhat.com> 1.0.1-6
432fa2
- rebuilt
432fa2
432fa2
* Wed Feb 23 2005 Karel Zak <kzak@redhat.com> 1.0.1-5
432fa2
- lockdev errs on /dev/input/ttyACM0 (3-component pathname) (#126082, #98160, #74454)
432fa2
432fa2
* Fri Oct 22 2004 Adrian Havill <havill@redhat.com> 1.0.1-4
432fa2
- don't unlock files if pid still exists (#128104)
432fa2
432fa2
* Tue Jun 15 2004 Elliot Lee <sopwith@redhat.com>
432fa2
- rebuilt
432fa2
432fa2
* Tue Mar 02 2004 Elliot Lee <sopwith@redhat.com>
432fa2
- rebuilt
432fa2
432fa2
* Fri Feb 13 2004 Elliot Lee <sopwith@redhat.com>
432fa2
- rebuilt
432fa2
432fa2
* Tue Sep  9 2003 Nalin Dahyabhai <nalin@redhat.com> 1.0.1-1.3
432fa2
- rebuild
432fa2
432fa2
* Mon Sep  8 2003 Nalin Dahyabhai <nalin@redhat.com> 1.0.1-1.2
432fa2
- rebuild
432fa2
432fa2
* Wed Aug 20 2003 Adrian Havill <havill@redhat.com> 1.0.1-1.1
432fa2
- bump n-v-r for 3.0E
432fa2
432fa2
* Fri Aug 15 2003 Adrian Havill <havill@redhat.com> 1.0.1-1
432fa2
- bumped version
432fa2
- make the dev rewrite work with ttys in the /dev/input subdir, not just
432fa2
  the base level dir (#98160)
432fa2
432fa2
* Wed Jun 04 2003 Elliot Lee <sopwith@redhat.com>
432fa2
- rebuilt
432fa2
432fa2
* Tue Feb 04 2003 Florian La Roche <Florian.LaRoche@redhat.de>
432fa2
- add symlink to shared lib
432fa2
432fa2
* Wed Jan 22 2003 Tim Powers <timp@redhat.com>
432fa2
- rebuilt
432fa2
432fa2
* Fri Nov 29 2002 Jeff Johnson <jbj@redhat.com>
432fa2
- don't segfault if device arg is missing.
432fa2
432fa2
* Fri Jun 21 2002 Tim Powers <timp@redhat.com>
432fa2
- automated rebuild
432fa2
432fa2
* Wed Jun  5 2002 Jeff Johnson <jbj@redhat.com> 1.0.0-19
432fa2
- fix: don't ignore signals, use default behavior instead (#63468).
432fa2
432fa2
* Thu May 23 2002 Tim Powers <timp@redhat.com>
432fa2
- automated rebuild
432fa2
432fa2
* Mon Feb 25 2002 Nalin Dahyabhai <nalin@redhat.com> 1.0.0-16
432fa2
- include liblockdev.so so that programs can link to a shared liblockdev
432fa2
- fix shared library version numbers
432fa2
432fa2
* Wed Jan 09 2002 Tim Powers <timp@redhat.com>
432fa2
- automated rebuild
432fa2
432fa2
* Thu Nov 29 2001 Trond Eivind Glomsrod <teg@redhat.com> 1.0.0-16
432fa2
- Rebuilt
432fa2
432fa2
* Fri Oct 26 2001 Trond Eivind Glomsrod <teg@redhat.com> 1.0.0-15
432fa2
- Add copyright/license info to baudboy.h (#54321)
432fa2
432fa2
* Tue Sep  4 2001 Jeff Johnson <jbj@redhat.com>
432fa2
- swap egid and gid for lockdev's access(2) device check (#52029).
432fa2
432fa2
* Tue Aug 28 2001 Jeff Johnson <jbj@redhat.com>
432fa2
- typo in include file (#52704).
432fa2
- map specific errno's into status for return from helper.
432fa2
432fa2
* Tue Aug 14 2001 Jeff Johnson <jbj@redhat.com>
432fa2
- set exit status correctly.
432fa2
432fa2
* Thu Aug  9 2001 Bill Nottingham <notting@redhat.com>
432fa2
- check that we can open the device r/w before locking
432fa2
- fix calling lockdev without any arguments
432fa2
- fix waitpid() call in baudboy.h
432fa2
- use umask(002), not umask(0)
432fa2
432fa2
* Wed Aug  8 2001 Bill Nottingham <notting@redhat.com>
432fa2
- add lock group here, own /var/lock as well
432fa2
432fa2
* Sun Aug  5 2001 Jeff Johnson <jbj@redhat.com>
432fa2
- include setgid helper binary and baudboy.h.
432fa2
432fa2
* Mon Jun 18 2001 Trond Eivind Glomsrod <teg@redhat.com>
432fa2
- Make the -devel depend on the main package
432fa2
432fa2
* Sun Aug 06 2000 Trond Eivind Glomsrod <teg@redhat.com>
432fa2
- rebuild
432fa2
432fa2
* Wed Jul 12 2000 Prospector <bugzilla@redhat.com>
432fa2
- automatic rebuild
432fa2
432fa2
* Sat Jun 17 2000 Bill Nottingham <notting@redhat.com>
432fa2
- add %%defattr for -devel
432fa2
432fa2
* Sat Jun 10 2000 Trond Eivind Glomsrod <teg@redhat.com>
432fa2
- use %%{_mandir}
432fa2
432fa2
* Thu May 04 2000 Trond Eivind Glomsrod <teg@redhat.com>
432fa2
- first build