diff --git a/packaging/rpm/Makefile b/packaging/rpm/Makefile new file mode 100644 index 0000000..cfa2a96 --- /dev/null +++ b/packaging/rpm/Makefile @@ -0,0 +1,26 @@ +# Build the clatd RPM package from the GIT packaging/rpm directory. +# +# This package should be able to be built from the GIT repo by typing +# make in the packaging/rpm directory. +# +# If this doesn't happen then that is a bug that needs to be reported. +# There may be better ways, of so, please educate me. + +SPECFILE=clatd.el6.spec +NAME := $(shell grep '^Name: ' < $(SPECFILE) | sed -e 's;^Name: ;;') +VERSION := $(shell grep '^Version: ' < $(SPECFILE) | sed -e 's;^Version: ;;') +FILENAME=${NAME}-${VERSION} +TARNAME=${FILENAME}.tar.gz + +TOPDIR=$(shell cd ../..; echo `pwd`) +DESTDIR=`pwd` + +all : + cd ../../..; \ + rm -rf ${FILENAME}; \ + cp -r ${TOPDIR} ${FILENAME}; \ + tar cfz ${TARNAME} ${FILENAME} --exclude=.git; \ + rm -rf ${FILENAME} + mv ../../../${TARNAME} . + rpmbuild -ta ${TARNAME} + rm -rf ${TARNAME} diff --git a/packaging/rpm/clatd.el6.spec b/packaging/rpm/clatd.el6.spec new file mode 100644 index 0000000..288f840 --- /dev/null +++ b/packaging/rpm/clatd.el6.spec @@ -0,0 +1,54 @@ +Summary: Implements IPv4 access in an IPv6-only environment. +Name: clatd +Version: 1.4 +Release: 1 +Source0: %{name}-%{version}.tar.gz +License: Copyright (c) 2014 Tore Anderson +Group: Utilities/System +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release} +BuildArch: noarch +Packager: David Summers +Url: https://github.com/toreanderson/clatd +Requires: perl +Requires: perl-IO-Socket-INET6 +Requires: perl-Net-DNS +Requires: perl-Net-IP +Requires: tayga + +%description +Implements IPv4 access in an IPv6-only environment as the CLAT component of +the 464XLAT network architecture specified in RFC 6877. + +It connects to an upstream PLAT (which is a typically a Stateful NAT64). + +%changelog +* Thu Dec 17 2015 David Summers 1.4-1 +- Updated to 1.4. + +* Wed Apr 08 2015 David Summers 1.0-1 +- First packaged version + +%prep +%setup -q -n %{name}-%{version} + +%build + +%install +rm -rf $RPM_BUILD_ROOT + +# Copy clatd perl script. +mkdir -p $RPM_BUILD_ROOT/usr/sbin/ +cp clatd $RPM_BUILD_ROOT/usr/sbin + +# Copy init script for upstart. +mkdir -p $RPM_BUILD_ROOT/etc/init +cp scripts/clatd.upstart $RPM_BUILD_ROOT/etc/init/clatd.conf + +%clean +rm -rf %{buildroot} + +%files +%defattr(-,root,root) +%doc README.pod LICENCE +/etc/init/* +/usr/sbin/*