summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2010-08-11 12:10:19 -0400
committerStephen Gallagher <sgallagh@redhat.com>2010-08-18 12:28:18 -0400
commit169aef0315b86c1a66e6d792c2a533fafc91dd53 (patch)
tree394f67407501d1a808b3895e435ce72020ce88c5
parente30512271d235f5812d4ca9ab26a9d5c8bbbca79 (diff)
downloadding-libs-169aef0315b86c1a66e6d792c2a533fafc91dd53.tar.gz
ding-libs-169aef0315b86c1a66e6d792c2a533fafc91dd53.tar.xz
ding-libs-169aef0315b86c1a66e6d792c2a533fafc91dd53.zip
dhash: Add targets for RPM build
-rw-r--r--dhash/Makefile.am29
-rw-r--r--dhash/configure.ac2
-rw-r--r--dhash/contrib/libdhash.spec.in87
3 files changed, 116 insertions, 2 deletions
diff --git a/dhash/Makefile.am b/dhash/Makefile.am
index d5a5618..cf73d80 100644
--- a/dhash/Makefile.am
+++ b/dhash/Makefile.am
@@ -10,7 +10,7 @@ ACLOCAL_AMFLAGS = -I m4
pkgconfigdir = $(libdir)/pkgconfig
dist_pkgconfig_DATA = dhash.pc
-dist_noinst_DATA = m4
+dist_noinst_DATA = m4 contrib/libdhash.spec.in
dist_include_HEADERS = dhash.h
@@ -33,3 +33,30 @@ dist_examples_DATA = examples/dhash_test.c examples/dhash_example.c
dist_doc_DATA = README
tests: all $(check_PROGRAMS)
+
+builddir ?= .
+RPMBUILD ?= $(PWD)/rpmbuild
+
+rpmroot:
+ mkdir -p $(RPMBUILD)/BUILD
+ mkdir -p $(RPMBUILD)/RPMS
+ mkdir -p $(RPMBUILD)/SOURCES
+ mkdir -p $(RPMBUILD)/SPECS
+ mkdir -p $(RPMBUILD)/SRPMS
+
+rpms: dist-gzip rpmroot
+ cp $(builddir)/contrib/libdhash.spec $(RPMBUILD)/SPECS
+ cp $(distdir).tar.gz $(RPMBUILD)/SOURCES
+ cd $(RPMBUILD); \
+ rpmbuild --define "_topdir $(RPMBUILD)" -ba SPECS/libdhash.spec
+
+# make srpms will use the old digest algorithm to be compatible
+# with RHEL5
+srpm: dist-gzip rpmroot
+ cp $(builddir)/contrib/libdhash.spec $(RPMBUILD)/SPECS
+ cp $(distdir).tar.gz $(RPMBUILD)/SOURCES
+ cd $(RPMBUILD); \
+ rpmbuild --define "_topdir $(RPMBUILD)" \
+ --define _source_filedigest_algorithm=1 \
+ -bs SPECS/libdhash.spec
+
diff --git a/dhash/configure.ac b/dhash/configure.ac
index 684e9ae..d15d90d 100644
--- a/dhash/configure.ac
+++ b/dhash/configure.ac
@@ -27,5 +27,5 @@ if test x$docdir = x; then
AC_SUBST([docdir], ${datadir}/doc/AC_PACKAGE_NAME)
fi
-AC_CONFIG_FILES([Makefile dhash.pc])
+AC_CONFIG_FILES([Makefile dhash.pc contrib/libdhash.spec])
AC_OUTPUT
diff --git a/dhash/contrib/libdhash.spec.in b/dhash/contrib/libdhash.spec.in
new file mode 100644
index 0000000..0408979
--- /dev/null
+++ b/dhash/contrib/libdhash.spec.in
@@ -0,0 +1,87 @@
+Name: @PACKAGE_NAME@
+Version: @PACKAGE_VERSION@
+Release: 0%{?dist}
+Group: Development/Libraries
+Summary: Dynamic hash table
+License: LGPLv3+
+URL: http://fedorahosted.org/sssd/
+Source0: %{name}-%{version}.tar.gz
+BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
+
+### Patches ###
+
+### Dependencies ###
+
+### Build Dependencies ###
+
+BuildRequires: autoconf
+BuildRequires: automake
+BuildRequires: libtool
+BuildRequires: m4
+
+%description
+A hash table which will dynamically resize to achieve optimal storage & access
+time properties
+
+%package devel
+Summary: Development files for libdhash
+Group: Development/Libraries
+Requires: libdhash = %{version}-%{release}
+License: LGPLv3+
+
+%description devel
+A hash table which will dynamically resize to achieve optimal storage & access
+time properties
+
+%prep
+%setup -q
+
+%build
+%configure \
+ --disable-static \
+ --disable-rpath
+
+make %{?_smp_mflags}
+
+%check
+make %{?_smp_mflags} check
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+make install DESTDIR=$RPM_BUILD_ROOT
+
+# Remove the example files from the output directory
+# We will copy them directly from the source directory
+# for packaging
+rm -f \
+ $RPM_BUILD_ROOT/usr/share/doc/libdhash/README \
+ $RPM_BUILD_ROOT/usr/share/doc/libdhash/examples/dhash_example.c \
+ $RPM_BUILD_ROOT/usr/share/doc/libdhash/examples/dhash_test.c
+
+# Remove .la files created by libtool
+rm -f $RPM_BUILD_ROOT/%{_libdir}/libdhash.la
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(-,root,root,-)
+%doc COPYING COPYING.LESSER
+%{_libdir}/libdhash.so.1
+%{_libdir}/libdhash.so.1.0.0
+
+%files devel
+%defattr(-,root,root,-)
+%{_includedir}/dhash.h
+%{_libdir}/libdhash.so
+%{_libdir}/pkgconfig/dhash.pc
+%doc README examples/
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+%changelog
+* Mon Mar 15 2010 Stephen Gallagher <sgallagh@redhat.com> - @PACKAGE_VERSION@-0
+- Automated build of libdhash