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