You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
daemontools/daemontools.spec

178 lines
5.5 KiB
Plaintext

# $Id: daemontools.spec,v 1.2 2023/07/14 08:22:02 brianr Exp $
%define destdir %buildroot
%global myhome /usr/local
Buildroot: %_builddir/%name-%version-root
License: Check with djb
Group: Utilities/System
Name: daemontools
Provides: daemontools
Release: 7%{?dist}
Source: http://cr.yp.to/%{name}/%{name}-%{version}.tar.gz
# 2006 http://bugs.gentoo.org/124487
Patch0: warnings.patch
# 2007 error.h: '#include <errno.h>' instead of 'extern int errno;' https://bugs.gentoo.org/16396
Patch1: 0001-error.h-include-errno.h-instead-of-extern-int.patch
# 2008 supervise.c: ./supervise may be a symlink, if it's dangling, create link target
Patch2: 0002-supervise.c-.-supervise-may-be-a-symlink-if-it-s-da.patch
# 2014 make sure it can be compiled for cross target
Patch3: cross-compile.patch
# 2016 ERROR: daemontools-0.76-r0 do_package_qa: QA Issue: No GNU_HASH in the elf binary: '/build-poky/tmp/work/i586-poky-linux/daemontools/0.76-r0/packages-split/daemontools/usr/bin/tai64nlocal'
Patch4: 0001-daemontools-Fix-QA-Issue.patch
# 2022 Khem Raj Clang-15 errors out otherewise. Include needed headers for missing functions
Patch5: 0001-Fix-signature-of-main-function.patch
Summary: Various tools to start/stop/monitor daemons.
%define debug_package %{nil}
%define __arch_install_post %{nil}
URL: http://cr.yp.to/%{name}.html
Version: 0.76
%description
daemontools is a collection of tools for managing UNIX services.
supervise monitors a service. It starts the service and restarts the
service if it dies. Setting up a new service is easy: all supervise
needs is a directory with a run script that runs the service.
multilog saves error messages to one or more logs. It optionally
timestamps each line and, for each log, includes or excludes lines
matching specified patterns. It automatically rotates logs to limit
the amount of disk space used. If the disk fills up, it pauses and
tries again, without losing any data.
%prep
%setup -c -n package
cd admin/%name-%version
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%build
cd admin/%name-%version
sed -e 's}^parent.*}parent=/package/admin}' \
-e 's} /command/} %destdir/command/}g' \
-e 's}-p /command}-p %destdir/command}' \
-e 's}ln -s %destdir/command/}ln -s /command/}' \
-e 's} /usr/local/bin/} %destdir/usr/local/bin/}g' \
-e 's}/usr/local}%myhome}g' \
package/upgrade > package/upgrade'{new}'
if [ "$?" != 0 ]; then
exit 1
else
mv package/upgrade'{new}' package/upgrade
chmod 755 package/upgrade
fi
echo gcc $RPM_OPT_FLAGS -O2 --include /usr/include/errno.h > src/conf-cc
CC="gcc $RPM_OPT_FLAGS -s " CFLAGS="$RPM_OPT_FLAGS" \
package/compile
cd ../..
COMPILER="Compiler: $(gcc -v 2>&1 | tail -1)"
HARDWARE="Hardware: $(uname -m)"
LIBRARY="Library: $(rpm -q glibc)"
OSVERSION="OSversion: $(uname -sr)"
PACKAGER="Packager: %packager"
REDHATRELEASE="RedHat release: $(cat /etc/redhat-release)"
RPMVERSION="rpm version: $(rpm -q rpm)"
echo "The %name rpm was created in the following environment:
" > README.rpm
echo "$COMPILER
$HARDWARE
$LIBRARY
$OSVERSION
$PACKAGER
$REDHATRELEASE
$RPMVERSION
The packager above has made an honest attempt to make sure
the package behaves correctly.
" >> README.rpm
if test "%myhome" != "/usr/local"; then
echo "" >> README.rpm
echo "You cannot distribute this rpm publicly" >> README.rpm
fi
%install
mkdir -p %destdir/%myhome/bin
mkdir -p %destdir/service
mkdir -p %destdir/package
mkdir -p %destdir/%{_docdir}/%name-%version
mv README.rpm %destdir/%{_docdir}/%name-%version
cd admin/%name-%version
mv package/README %destdir/%{_docdir}/%name-%version
mv src/{CHANGES,TODO} %destdir/%{_docdir}/%name-%version
package/upgrade
cd ../..
cp -a admin %destdir/package/
/bin/rm %destdir/package/admin/%name-%version/src/*
/bin/rm -r %destdir/package/admin/%name-%version/compile
%post
cd /package/admin/%name-%version
package/run
echo You may want to add /command to PATH.
%clean
rm -rf %destdir
%changelog
* Mon Mar 18 2024 Jean-Philippe Pialasse <jpp@koozali.org> 0.76-7.sme
- import patches from gentoo and openembedded to allow to build on el8 [SME: 12512]
* Thu Oct 26 2023 BogusDateBot
- Eliminated rpmbuild "bogus date" warnings due to inconsistent weekday,
by assuming the date is correct and changing the weekday.
* Fri Jul 14 2023 brian read <brianr@koozali.org>
- add {} round vars in source lines so that can be converted to git [SME: 12380]
* Sun Apr 29 2007 Shad L. Lords <slords@mail.com>
- Clean up spec so package can be built by koji/plague
* Tue Apr 24 2007 Charlie Brady <charlieb@e-smith.com> 0.76-6
- disable build of debuginfo package.
* Thu Dec 07 2006 Shad L. Lords <slords@mail.com>
- Update to new release naming. No functional changes.
- Make Packager generic
* Tue Dec 20 2005 Charlie Brady <charlieb@e-smith.com> 0.76-4es1
- Fixes for build under CentOS4 and FC4.
- Move documentation to RedHat canonical location.
* Wed Jun 23 2004 Charlie Brady <charlieb@e-smith.com> 0.76-3es1
- Adjust compiler configuration to work around glibc errno issue
* Thu Aug 23 2001 Mate Wierdl <mw@csi.hu>
- adjusted for slashpackage setup
%files
%defattr(-,root,root)
%doc %dir %{_docdir}/%name-%version
%doc %{_docdir}/%name-%version/CHANGES
%doc %{_docdir}/%name-%version/README*
%doc %{_docdir}/%name-%version/TODO
%dir%attr(1755,root,root) /package
%dir%attr(755,root,root) /command
%dir%attr(755,root,root) /service
%dir /package/admin/%name-%version/src
/package/admin/%name-%version/command
/package/admin/%name-%version/package
/package/admin/%name
/command/*
%myhome/bin/*