summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2009-06-27 23:47:52 +0000
committerRalf Baechle <ralf@linux-mips.org>2009-06-27 23:47:52 +0000
commit07e0485950387c5a626a36563d5cc593534a7695 (patch)
tree1120b133a8c678edc805728b26a07203ed7bdd74
parentbd7a022058c5d4a59f5b87065bb1f4b45bbd6336 (diff)
Add support for building rpm packages.
Now just a rpmbuild -ta <foo.tar.gz> will do.
-rw-r--r--.cvsignore1
-rw-r--r--ChangeLog1
-rw-r--r--Makefile.am2
-rw-r--r--configure.ac7
-rw-r--r--libax25.spec.in61
5 files changed, 70 insertions, 2 deletions
diff --git a/.cvsignore b/.cvsignore
index 036c57f..ae03aa4 100644
--- a/.cvsignore
+++ b/.cvsignore
@@ -12,6 +12,7 @@ config.sub
configure
depcomp
install-sh
+libax25.spec
ltmain.sh
missing
Makefile
diff --git a/ChangeLog b/ChangeLog
index 93e9232..4edd350 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,7 @@ libax25 0.0.12
buildable on modern distributions.
* libax25 will again find AX.25 interfaces if if they do not have an
IP address assigned.
+ * Add support for building rpm packages.
-- Ralf Baechle DL5RB <ralf@linux-mips.org> Sat, 6 Jun 2009 17:00:00 +0100
diff --git a/Makefile.am b/Makefile.am
index 1705888..6dd22f4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -60,7 +60,7 @@ libax25io_la_SOURCES = \
man_MANS = ax25.3 rose.3 axports.5 rsports.5 nrports.5
-EXTRA_DIST= $(man_MANS) glibc.patch $(etcfiles)
+EXTRA_DIST= $(man_MANS) glibc.patch $(etcfiles) libax25.spec
AX25_SYSCONFDIR=@sysconfdir@/ax25/
AX25_LOCALSTATEDIR=@localstatedir@/ax25/
diff --git a/configure.ac b/configure.ac
index cb53cf6..10f1709 100644
--- a/configure.ac
+++ b/configure.ac
@@ -62,5 +62,10 @@ if test "x$GCC" = "xyes"; then
fi
dnl Checks for library functions.
-AC_CONFIG_FILES([Makefile])
+basever=$(echo $PACKAGE_VERSION | sed -e 's@-.*$@@')
+AC_SUBST(BASEVERSION, [$basever])
+extraver=$(echo $PACKAGE_VERSION | sed -e 's@@<:@^-@:>@*-@@' -e 's@-@_@')
+AC_SUBST(EXTRAVERSION, [$extraver])
+
+AC_CONFIG_FILES([Makefile libax25.spec])
AC_OUTPUT
diff --git a/libax25.spec.in b/libax25.spec.in
new file mode 100644
index 0000000..b7e38c6
--- /dev/null
+++ b/libax25.spec.in
@@ -0,0 +1,61 @@
+Name: libax25
+Version: @BASEVERSION@@EXTRAVERSION@
+Release: 1
+Summary: AX.25 library for hamradio applications
+
+Group: System Environment/Libraries
+License: LGPLv2+
+URL: http://www.linux-ax25.org/
+Source0: http://www.linux-ax25.org/pub/%{name}/%{name}-@VERSION@.tar.gz
+BuildRoot: %{_tmppath}/%{name}-@VERSION@-%{release}-root-%(%{__id_u} -n)
+
+%description
+libax25 is a library for ham radio applications that use the AX.25, NETROM
+or ROSE protocols. Included are routines to do ax25 address parsing, common
+ax25 application config file parsing, etc.
+
+%package devel
+
+Summary: Development files for %{name}
+Group: Development/Libraries
+Requires: %{name} = %{version}-%{release}
+
+%description devel
+The %{name}-devel package contains libraries and header files for
+developing applications that use %{name}.
+
+%prep
+
+%setup -q -n %{name}-@VERSION@
+
+%build
+%configure --disable-static
+make %{?_smp_mflags}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+make install DESTDIR=$RPM_BUILD_ROOT
+find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+%files
+%defattr(-,root,root,-)
+%doc AUTHORS ChangeLog COPYING README
+%{_libdir}/*.so.*
+%{_mandir}/man?/*
+
+%files devel
+%defattr(-,root,root,-)
+%doc AUTHORS ChangeLog COPYING README
+%{_includedir}/*
+%{_libdir}/*.so
+
+%changelog
+* Sat Jun 27 2009 Ralf Baechle <ralf@linux-mips.org>
+- Initial version