improved RPM spec file so mock can be used to build RPMs, add 'make rpm' target

git-svn-id: svn://svn.code.sf.net/p/openhip/code/hip/trunk@230 4c5cb64f-9889-4596-9799-84b02dc3effa
This commit is contained in:
Jeff Ahrenholz 2012-03-21 22:59:23 +00:00
parent 6e8306fcdb
commit a411b7e941
2 changed files with 18 additions and 25 deletions

View File

@ -42,10 +42,16 @@ DISTCLEANFILES = stamp-h1 aclocal.m4 config.h.in configure Makefile.in
dist-hook:
rm -rf `find $(distdir)/ -type d -name .svn`
.PHONY: deb
deb:
mkdir -p debian
cp -vf src/linux/deb/* debian/
@echo "Ready to run pbuilder."
.PHONY: rpm
rpm:
rpmdev-setuptree
cp -afv openhip-*.tar.gz ~/rpmbuild/SOURCES
cp -afv src/linux/openhip.spec ~/rpmbuild/SPECS
rpmbuild -bs ~/rpmbuild/SPECS/openhip.spec

View File

@ -3,10 +3,12 @@ Name: openhip
License: MIT
Group: System Environment/Daemons
Summary: OpenHIP Host Identity Protocol usermode for Linux
Prefix: /usr/local
Prefix: /usr
Provides: openhip
Release: 1
Source: openhip-%{version}.tgz
Requires: libxml2 openssl
BuildRequires: make automake autoconf pkgconfig libxml2-devel openssl-devel
Source: openhip-%{version}.tar.gz
URL: http://www.openhip.org
Version: %{version}
Buildroot: /tmp/openhiprpm
@ -16,49 +18,34 @@ OpenHIP is a free, open-source implementation of the Host Identity Protocol (HIP
HIP is a specific proposal to decouple network identity from network location in the Internet protocol stack. Historically, IP addresses have served both functions. This dual use of IP addresses is becoming problematic, and there have been many research efforts aimed at studying the decoupling of identifier and locator in the network stack. HIP is a specific proposal that uses public/private key pairs as the host identifiers.
%prep
%setup -q
%build
./bootstrap.sh
./configure
%configure
make
%install
rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT install
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
/usr/local/sbin/hip
/usr/local/sbin/hitgen
/usr/local/sbin/hipstatus
%config /usr/local/etc/hip/known_host_identities.xml
%{_sbindir}/hip
%{_sbindir}/hitgen
%{_sbindir}/hipstatus
%config /etc/hip/known_host_identities.xml
%doc README
%doc AUTHORS
%doc LICENSE
%post
#
# only run these commands upon first installation
if [ "$1" = 1 ] ;
then
/usr/local/sbin/hitgen -conf -file /usr/local/etc/hip/hip.conf
/usr/local/sbin/hitgen -noinput -file /usr/local/etc/hip/my_host_identities.xml
mkdir -p /usr/local/var/log /usr/local/var/run
fi;
%changelog
* Wed Mar 21 2012 Jeff Ahrenholz <siliconja@sourceforge.net> - 0.9
- updated for 0.9 release, use mock, don't use /usr/local dirs
* Mon May 18 2009 Jeff Ahrenholz <siliconja@sourceforge.net> - 0.6
- updated for 0.6 release, fix install using DESTDIR instead of changing prefix
* Wed Jan 10 2007 Jeff Ahrenholz <siliconja@sourceforge.net> - 0.4