[openhpi] update to 3.0.0
Dan Horák
sharkcz at fedoraproject.org
Wed Mar 7 10:50:52 UTC 2012
commit 84a58e8410c3c17033809ca332243e07aa06b381
Author: Dan Horák <dan at danny.cz>
Date: Wed Mar 7 11:50:46 2012 +0100
update to 3.0.0
- convert from initscript to systemd unit
.gitignore | 1 +
openhpi-3.0.0-execstack.patch | 9 ++
openhpi-3.0.0-systemd.patch | 177 +++++++++++++++++++++++++++++++++++++++++
openhpi.initd | 112 --------------------------
openhpi.spec | 77 +++++++++---------
openhpi.sysconfig | 7 --
sources | 2 +-
7 files changed, 225 insertions(+), 160 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 867095a..18886a9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
openhpi-2.14.1.tar.gz
/openhpi-2.15.0.tar.gz
/openhpi-2.17.0.tar.gz
+/openhpi-3.0.0.tar.gz
diff --git a/openhpi-3.0.0-execstack.patch b/openhpi-3.0.0-execstack.patch
new file mode 100644
index 0000000..a9f59da
--- /dev/null
+++ b/openhpi-3.0.0-execstack.patch
@@ -0,0 +1,9 @@
+--- openhpi/trunk/clients/hpixml/schema.S 2012/02/15 13:07:42 7396
++++ openhpi/trunk/clients/hpixml/schema.S 2012/03/06 15:51:18 7397
+@@ -10,3 +10,6 @@
+ schema_end:
+ _schema_end:
+
++#if defined(__linux__) && defined(__ELF__)
++.section .note.GNU-stack, "", %progbits
++#endif
diff --git a/openhpi-3.0.0-systemd.patch b/openhpi-3.0.0-systemd.patch
new file mode 100644
index 0000000..f883f70
--- /dev/null
+++ b/openhpi-3.0.0-systemd.patch
@@ -0,0 +1,177 @@
+diff -up openhpi-3.0.0/openhpid/Makefile.am.systemd openhpi-3.0.0/openhpid/Makefile.am
+--- openhpi-3.0.0/openhpid/Makefile.am.systemd 2011-10-17 17:57:33.000000000 +0200
++++ openhpi-3.0.0/openhpid/Makefile.am 2012-03-06 10:54:07.000000000 +0100
+@@ -27,6 +27,7 @@ DIST_SUBDIRS = t
+
+ EXTRA_DIST = \
+ openhpid.sh.in \
++ openhpid.service.in \
+ Makefile.mingw32 \
+ openhpid-win32.cpp \
+ version.rc
+@@ -82,11 +83,17 @@ endif
+
+
+ install-data-local:
++if ENABLE_SYSTEMD
++ $(mkinstalldirs) $(DESTDIR)$(unitdir)
++ $(INSTALL) -m 0644 openhpid.service $(DESTDIR)$(unitdir)
++else
+ $(mkinstalldirs) $(DESTDIR)$(sysconfdir)/init.d
+ $(INSTALL) -m 0755 openhpid.sh $(DESTDIR)$(sysconfdir)/init.d/openhpid
++endif
+
+ uninstall-local:
+ rm -f $(DESTDIR)$(sysconfdir)/init.d/openhpid
++ rm -f $(DESTDIR)$(unitdir)/openhpid.service
+
+ clean-local:
+ rm -f *~ core core.*
+diff -up openhpi-3.0.0/openhpid/Makefile.in.systemd openhpi-3.0.0/openhpid/Makefile.in
+--- openhpi-3.0.0/openhpid/Makefile.in.systemd 2012-03-06 10:54:38.000000000 +0100
++++ openhpi-3.0.0/openhpid/Makefile.in 2012-03-06 10:56:11.000000000 +0100
+@@ -290,6 +290,7 @@ target_alias = @target_alias@
+ top_build_prefix = @top_build_prefix@
+ top_builddir = @top_builddir@
+ top_srcdir = @top_srcdir@
++unitdir = @unitdir@
+ MAINTAINERCLEANFILES = Makefile.in *~
+ AM_CPPFLAGS = -DG_LOG_DOMAIN=\"openhpid\"
+ INCLUDES = \
+@@ -299,6 +300,7 @@ SUBDIRS = t
+ DIST_SUBDIRS = t
+ EXTRA_DIST = \
+ openhpid.sh.in \
++ openhpid.service.in \
+ Makefile.mingw32 \
+ openhpid-win32.cpp \
+ version.rc
+@@ -771,8 +773,10 @@ uninstall-am: uninstall-local uninstall-
+ .NOTPARALLEL:
+
+ install-data-local:
+- $(mkinstalldirs) $(DESTDIR)$(sysconfdir)/init.d
+- $(INSTALL) -m 0755 openhpid.sh $(DESTDIR)$(sysconfdir)/init.d/openhpid
++ at ENABLE_SYSTEMD_TRUE@ $(mkinstalldirs) $(DESTDIR)$(unitdir)
++ at ENABLE_SYSTEMD_TRUE@ $(INSTALL) -m 0644 openhpid.service $(DESTDIR)$(unitdir)
++ at ENABLE_SYSTEMD_FALSE@ $(mkinstalldirs) $(DESTDIR)$(sysconfdir)/init.d
++ at ENABLE_SYSTEMD_FALSE@ $(INSTALL) -m 0755 openhpid.sh $(DESTDIR)$(sysconfdir)/init.d/openhpid
+
+ uninstall-local:
+ rm -f $(DESTDIR)$(sysconfdir)/init.d/openhpid
+diff -up openhpi-3.0.0/configure.ac.systemd openhpi-3.0.0/configure.ac
+--- openhpi-3.0.0/configure.ac.systemd 2011-10-17 17:57:33.000000000 +0200
++++ openhpi-3.0.0/configure.ac 2012-03-06 10:54:07.000000000 +0100
+@@ -662,6 +662,17 @@ AC_ARG_ENABLE([man],
+ AC_SUBST(MAN,"")
+ fi])
+
++dnl systemd system unit files location
++AC_ARG_WITH([systemdsystemunitdir],
++ AS_HELP_STRING([--with-systemdsystemunitdir@<:@=DIR@:>@],[systemd system unit files location]),
++ [enable_systemd=yes],
++ [enable_systemd=no])
++
++dnl enable systemd and set unit dir
++AM_CONDITIONAL([ENABLE_SYSTEMD], [test "x$enable_systemd" = "xyes"])
++unitdir=$with_systemdsystemunitdir
++AC_SUBST(unitdir)
++
+ AC_CONFIG_FILES([openhpi.spec
+ openhpi.pc
+ rt-env.sh
+@@ -704,6 +715,7 @@ AC_CONFIG_FILES([openhpi.spec
+ docs/man/Makefile
+ openhpid/Makefile
+ openhpid/openhpid.sh
++ openhpid/openhpid.service
+ openhpid/t/Makefile
+ openhpid/t/ohpi/Makefile
+ hpi_shell/Makefile
+diff -up openhpi-3.0.0/configure.systemd openhpi-3.0.0/configure
+--- openhpi-3.0.0/configure.systemd 2012-03-06 10:57:04.000000000 +0100
++++ openhpi-3.0.0/configure 2012-03-06 11:01:40.000000000 +0100
+@@ -785,6 +785,9 @@ ac_includes_default="\
+ #endif"
+
+ ac_subst_vars='LTLIBOBJS
++unitdir
++ENABLE_SYSTEMD_FALSE
++ENABLE_SYSTEMD_TRUE
+ MAN
+ found_pod2man
+ OPENHPI_INCLUDES
+@@ -991,6 +994,7 @@ enable_debuggable
+ enable_debug_msgs
+ enable_werror
+ enable_man
++with_systemdsystemunitdir
+ '
+ ac_precious_vars='build_alias
+ host_alias
+@@ -1675,6 +1679,8 @@ Optional Packages:
+ --with-net-snmp-config=SCRIPT run SCRIPT as net-snmp-config
+ --with-varpath=PATH use directory PATH to store openhpi specific data [default=$prefix/var/lib/openhpi]
+ --with-pluginpath=PATH use directory PATH to locate plugin libraries [default=LIBDIR/openhpi]
++ --with-systemdsystemunitdir[=DIR]
++ systemd system unit files location
+
+ Some influential environment variables:
+ CC C compiler command
+@@ -18869,8 +18875,26 @@ else
+ fi
+ fi
+
++# Check whether --with-systemdsystemunitdir was given.
++if test "${with_systemdsystemunitdir+set}" = set; then :
++ withval=$with_systemdsystemunitdir; enable_systemd=yes
++else
++ enable_systemd=no
++fi
++
++
++ if test "x$enable_systemd" = "xyes"; then
++ ENABLE_SYSTEMD_TRUE=
++ ENABLE_SYSTEMD_FALSE='#'
++else
++ ENABLE_SYSTEMD_TRUE='#'
++ ENABLE_SYSTEMD_FALSE=
++fi
++
++unitdir=$with_systemdsystemunitdir
++
+
+-ac_config_files="$ac_config_files openhpi.spec openhpi.pc rt-env.sh Makefile utils/openhpiutils.pc utils/Makefile utils/t/Makefile utils/t/epath/Makefile utils/t/rpt/Makefile utils/t/sahpi/Makefile utils/t/el/Makefile utils/t/uid/Makefile utils/t/ann/Makefile transport/Makefile marshal/Makefile marshal/t/Makefile plugins/Makefile plugins/watchdog/Makefile plugins/ipmi/Makefile plugins/ipmi/t/Makefile plugins/snmp_bc/Makefile plugins/snmp_bc/t/Makefile plugins/sysfs/Makefile plugins/ipmidirect/Makefile plugins/ipmidirect/t/Makefile plugins/simulator/Makefile plugins/simulator/t/Makefile plugins/dynamic_simulator/Makefile plugins/rtas/Makefile plugins/ilo2_ribcl/Makefile plugins/oa_soap/Makefile plugins/slave/Makefile plugins/test_agent/Makefile scripts/Makefile scripts/test/Makefile snmp/Makefile ssl/Makefile baselib/Makefile docs/Makefile docs/man/Makefile openhpid/Makefile openhpid/openhpid.sh openhpid/t/Makefile openhpid/t/ohpi/Makefile hpi_shell/Makefile cpp/Makefile cpp
/t/Makefile clients/Makefile clients/hpixml/Makefile"
++ac_config_files="$ac_config_files openhpi.spec openhpi.pc rt-env.sh Makefile utils/openhpiutils.pc utils/Makefile utils/t/Makefile utils/t/epath/Makefile utils/t/rpt/Makefile utils/t/sahpi/Makefile utils/t/el/Makefile utils/t/uid/Makefile utils/t/ann/Makefile transport/Makefile marshal/Makefile marshal/t/Makefile plugins/Makefile plugins/watchdog/Makefile plugins/ipmi/Makefile plugins/ipmi/t/Makefile plugins/snmp_bc/Makefile plugins/snmp_bc/t/Makefile plugins/sysfs/Makefile plugins/ipmidirect/Makefile plugins/ipmidirect/t/Makefile plugins/simulator/Makefile plugins/simulator/t/Makefile plugins/dynamic_simulator/Makefile plugins/rtas/Makefile plugins/ilo2_ribcl/Makefile plugins/oa_soap/Makefile plugins/slave/Makefile plugins/test_agent/Makefile scripts/Makefile scripts/test/Makefile snmp/Makefile ssl/Makefile baselib/Makefile docs/Makefile docs/man/Makefile openhpid/Makefile openhpid/openhpid.sh openhpid/openhpid.service openhpid/t/Makefile openhpid/t/ohpi/Makefile hpi_shell
/Makefile cpp/Makefile cpp/t/Makefile clients/Makefile clients/hpixml/Makefile"
+
+
+ cat >confcache <<\_ACEOF
+@@ -19026,6 +19050,13 @@ $as_echo "$as_me: error: conditional \"H
+ Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+ fi
++if test -z "${ENABLE_SYSTEMD_TRUE}" && test -z "${ENABLE_SYSTEMD_FALSE}"; then
++ { { $as_echo "$as_me:$LINENO: error: conditional \"ENABLE_SYSTEMD\" was never defined.
++Usually this means the macro was only invoked conditionally." >&5
++$as_echo "$as_me: error: conditional \"ENABLE_SYSTEMD\" was never defined.
++Usually this means the macro was only invoked conditionally." >&2;}
++ { (exit 1); exit 1; }; }
++fi
+
+ : ${CONFIG_STATUS=./config.status}
+ ac_write_fail=0
+diff -up openhpi-3.0.0/openhpid/openhpid.service.in.systemd openhpi-3.0.0/openhpid/openhpid.service.in
+--- openhpi-3.0.0/openhpid/openhpid.service.in.systemd 2012-03-06 10:54:07.000000000 +0100
++++ openhpi-3.0.0/openhpid/openhpid.service.in 2012-03-06 10:54:07.000000000 +0100
+@@ -0,0 +1,11 @@
++[Unit]
++Description=Daemon providing access to the SAF Hardware Platform Interface
++After=syslog.target
++
++[Service]
++Type=forking
++PIDFile=/var/run/openhpid.pid
++ExecStart=@sbindir@/openhpid -c @sysconfdir@/openhpi/openhpi.conf
++
++[Install]
++WantedBy=multi-user.target
diff --git a/openhpi.spec b/openhpi.spec
index 4aba432..49010e8 100644
--- a/openhpi.spec
+++ b/openhpi.spec
@@ -2,15 +2,16 @@
Summary: Hardware Platform Interface library and tools
Name: openhpi
-Version: 2.17.0
-Release: 2%{?dist}
+Version: 3.0.0
+Release: 1%{?dist}
License: BSD
Group: System Environment/Base
URL: http://www.openhpi.org
Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
-Source1: %{name}.initd
-Source2: %{name}.sysconfig
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+# convert from initscript to systemd unit
+Patch0: %{name}-3.0.0-systemd.patch
+# remove executable stack
+Patch1: %{name}-3.0.0-execstack.patch-new
BuildRequires: libsysfs-devel
BuildRequires: net-snmp-devel
BuildRequires: OpenIPMI-devel
@@ -20,14 +21,11 @@ BuildRequires: openssl-devel
BuildRequires: ncurses-devel
BuildRequires: libxml2-devel
BuildRequires: docbook-utils
-%if 0%{?rhel} && 0%{?rhel} < 6
-BuildRequires: e2fsprogs-devel
-%else
BuildRequires: libuuid-devel
-%endif
-Requires(post): chkconfig
-Requires(preun): chkconfig
-Requires(preun): initscripts
+BuildRequires: systemd-units
+Requires(post): systemd-units
+Requires(preun): systemd-units
+Requires(postun): systemd-units
%description
@@ -57,8 +55,8 @@ The system libraries for the OpenHPI project.
%package devel
Group: Development/Libraries
Summary: The development environment for the OpenHPI project
-Requires: %{name}-libs = %{version}-%{release}
-Requires: glib2-devel, pkgconfig
+Requires: %{name}-libs%{?_isa} = %{version}-%{release}
+Requires: glib2-devel
%description devel
The development libraries and header files for the OpenHPI project.
@@ -66,6 +64,12 @@ The development libraries and header files for the OpenHPI project.
%prep
%setup -q
+%patch0 -p1 -b .systemd
+%patch1 -p2 -b .execstack
+# workaround dependecies between manually modified autotooled files
+touch aclocal.m4
+touch config.h.in
+touch configure
# fix permissions
chmod a-x plugins/simulator/*.[ch]
@@ -74,7 +78,7 @@ chmod a-x clients/*.[ch]
%build
export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
-%configure --disable-static
+%configure --disable-static --with-systemdsystemunitdir=%{_unitdir}
# Don't use rpath!
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
@@ -85,42 +89,35 @@ make %{?_smp_mflags}
%install
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
-mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig
-mkdir -p $RPM_BUILD_ROOT%{_initddir}
mkdir -p -m1777 $RPM_BUILD_ROOT%{_var}/lib/%{name}
make install DESTDIR=$RPM_BUILD_ROOT
-rm -f $RPM_BUILD_ROOT%{_sysconfdir}/init.d/openhpid
-install -p -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_initddir}/openhpid
-install -p -m 755 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/openhpid
-
rm -rf $RPM_BUILD_ROOT/%{_libdir}/*.la
rm -rf $RPM_BUILD_ROOT/%{_libdir}/%{name}/*.la
-# fix perms for generated docs
-chmod 0644 docs/hld/openhpi-manual/*.html
-
%check
make check
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-
%post
-/sbin/chkconfig --add openhpid
+if [ $1 -eq 1 ] ; then
+ # Initial installation
+ /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+fi
%preun
-if [ $1 = 0 ] ; then
- /sbin/service openhpid stop >/dev/null 2>&1
- /sbin/chkconfig --del openhpid
+if [ $1 -eq 0 ] ; then
+ # Package removal, not upgrade
+ /bin/systemctl --no-reload disable openhpid.service > /dev/null 2>&1 || :
+ /bin/systemctl stop openhpid.service > /dev/null 2>&1 || :
fi
%postun
-if [ "$1" -ge "1" ] ; then
- /sbin/service openhpid condrestart >/dev/null 2>&1
+/bin/systemctl daemon-reload >/dev/null 2>&1 || :
+if [ $1 -ge 1 ] ; then
+ # Package upgrade, not uninstall
+ /bin/systemctl try-restart openhpid.service >/dev/null 2>&1 || :
fi
%post libs -p /sbin/ldconfig
@@ -129,14 +126,12 @@ fi
%files
-%defattr(-,root,root,-)
-%doc README README.daemon docs/hld/openhpi-manual openhpi.conf.example
+%doc README README.daemon openhpi.conf.example plugins/*/*.pdf
%dir %{_sysconfdir}/%{name}
%config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf
%config(noreplace) %{_sysconfdir}/%{name}/%{name}client.conf
%config(noreplace) %{_sysconfdir}/%{name}/simulation.data
-%{_initddir}/openhpid
-%config(noreplace) %{_sysconfdir}/sysconfig/openhpid
+%{_unitdir}/openhpid.service
%attr(1777,root,root) %{_var}/lib/%{name}
%{_bindir}/*
%{_sbindir}/*
@@ -146,18 +141,20 @@ fi
%{_mandir}/man8/*
%files libs
-%defattr(-,root,root,-)
%doc COPYING
%{_libdir}/*.so.*
%files devel
-%defattr(-,root,root,-)
%{_libdir}/*.so
%{_includedir}/%{name}
%{_libdir}/pkgconfig/*.pc
%changelog
+* Tue Mar 06 2012 Dan Horák <dan[at]danny.cz> - 3.0.0-1
+- update to 3.0.0
+- convert from initscript to systemd unit
+
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 2.17.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
diff --git a/sources b/sources
index 79483d2..7df8a19 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-4e5aab65222f89d0c74f0a0e7190c286 openhpi-2.17.0.tar.gz
+9089cb59b732ff00b3805a1809405b4b openhpi-3.0.0.tar.gz
More information about the scm-commits
mailing list