[Cancd-commits] jlbec commits r7 - trunk
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Thu Aug 18 13:47:40 CDT 2005
Author: jlbec
Date: 2005-08-18 13:47:39 -0500 (Thu, 18 Aug 2005)
New Revision: 7
Added:
trunk/cancd.spec
Modified:
trunk/
trunk/Makefile
Log:
Basic RPM packaging
Property changes on: trunk
___________________________________________________________________
Name: svn:ignore
- .*.sw?
cancd
*.tar.gz
+ .*.sw?
cancd
*.tar.gz
*.src.rpm
Modified: trunk/Makefile
===================================================================
--- trunk/Makefile 2005-05-15 11:25:41 UTC (rev 6)
+++ trunk/Makefile 2005-08-18 18:47:39 UTC (rev 7)
@@ -6,10 +6,12 @@
cancd: cancd.o
install:
- cp cancd /usr/sbin
- chmod 0755 /usr/sbin/cancd
- cp cancd.init /etc/init.d/cancd
- chmod 0755 /etc/init.d/cancd
+ mkdir -p $(DESTDIR)/usr/sbin
+ cp cancd $(DESTDIR)/usr/sbin
+ chmod 0755 $(DESTDIR)/usr/sbin/cancd
+ mkdir -p $(DESTDIR)/etc/init.d
+ cp cancd.init $(DESTDIR)/etc/init.d/cancd
+ chmod 0755 $(DESTDIR)/etc/init.d/cancd
clean:
rm cancd cancd.o
@@ -18,6 +20,7 @@
Makefile \
cancd.c \
cancd.init \
+ cancd.spec \
kernel-list.h
DIST_DIR = cancd-$(VERSION)
@@ -29,3 +32,14 @@
@cp $(DIST_FILES) $(DIST_DIR)
tar -czvf $(DIST_ARCHIVE) $(DIST_DIR)
@rm -rf $(DIST_DIR)
+
+RPM_TOPDIR = $(CURDIR)
+RPMBUILD = $(shell /usr/bin/which rpmbuild 2>/dev/null || /usr/bin/which rpm 2>/dev/null || echo /bin/false)
+
+CHKCONFIG_DEP = $(shell if test -r /etc/SuSE-release; then echo aaa_base; else echo chkconfig; fi)
+
+srpm: dist
+ $(RPMBUILD) -bs --define "_sourcedir $(RPM_TOPDIR)" --define "_srcrpmdir $(RPM_TOPDIR)" --define "CANCD_VERSION $(VERSION)" --define "CHKCONFIG_DEP $(CHKCONFIG_DEP)" cancd.spec
+
+rpm: srpm
+ $(RPMBUILD) --rebuild --define "CANCD_VERSION $(VERSION)" --define "CHKCONFIG_DEP $(CHKCONFIG_DEP)" "cancd-$(VERSION)-1.src.rpm"
Added: trunk/cancd.spec
===================================================================
--- trunk/cancd.spec 2005-05-15 11:25:41 UTC (rev 6)
+++ trunk/cancd.spec 2005-08-18 18:47:39 UTC (rev 7)
@@ -0,0 +1,55 @@
+#
+# Spec file for cvsman
+#
+
+# Macros
+# This one is hardcoded because, well, it belongs there
+%define _prefix /usr
+
+Summary: The CA NetConsole Daemon
+Name: cancd
+Version: %{CANCD_VERSION}
+Release: 1
+Copyright: GPL
+Group: Applications/File
+Source: http://oss.oracle.com/projects/cancd/files/source/cancd-%{PACKAGE_VERSION}.tar.gz
+URL: http://oss.oracle.com/projects/cancd/
+Distribution: CALPG
+Vendor: Oracle Corporate Architecture Linux Projects Group
+Packager: Joel Becker <joel.becker at oracle.com>
+
+# Needs an initscripts require
+Requires: initscripts >= 6.44, %{CHKCONFIG_DEP}
+
+BuildRoot: %{_tmppath}/cancd-%{PACKAGE_VERSION}-%{PACKAGE_RELEASE}-root
+
+%description
+This is the CA NetConsole Daemon, a daemon to receive output from the
+Linux netconsole driver.
+
+%prep
+%setup
+
+%build
+make
+
+%install
+make DESTDIR="$RPM_BUILD_ROOT" install
+mkdir "${RPM_BUILD_ROOT}/etc/rc.d"
+mv "${RPM_BUILD_ROOT}/etc/init.d" "${RPM_BUILD_ROOT}/etc/rc.d"
+
+%clean
+rm -rf "$RPM_BUILD_ROOT"
+
+%post
+/sbin/chkconfig --add cancd
+
+%preun
+if [ $1 = 0 ]; then
+ /sbin/chkconfig --del cancd
+fi
+
+%files
+%defattr(-,root,root)
+/usr/sbin/cancd
+%config /etc/rc.d/init.d/cancd
More information about the Cancd-commits
mailing list