summaryrefslogtreecommitdiffstats
path: root/collection
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2010-08-11 16:26:36 -0400
committerStephen Gallagher <sgallagh@redhat.com>2010-08-18 12:28:18 -0400
commit8a55c780d1a3d22b27e3746158322ff0de64b572 (patch)
tree18cdc33b9e3b5c3a0f3ffc4f8cd9f5fa1d275744 /collection
parent88a0a472f61c1301ca31f9d443647d11f05c06d0 (diff)
downloadding-libs2-8a55c780d1a3d22b27e3746158322ff0de64b572.tar.gz
ding-libs2-8a55c780d1a3d22b27e3746158322ff0de64b572.tar.xz
ding-libs2-8a55c780d1a3d22b27e3746158322ff0de64b572.zip
collection: add RPM build targets
Diffstat (limited to 'collection')
-rw-r--r--collection/Makefile.am29
-rw-r--r--collection/configure.ac2
-rw-r--r--collection/contrib/libcollection.spec.in86
3 files changed, 115 insertions, 2 deletions
diff --git a/collection/Makefile.am b/collection/Makefile.am
index 1d9e98c..0aff10e 100644
--- a/collection/Makefile.am
+++ b/collection/Makefile.am
@@ -26,7 +26,7 @@ dist_include_HEADERS = \
collection_queue.h \
collection_stack.h
-dist_noinst_DATA = m4
+dist_noinst_DATA = m4 contrib/libcollection.spec.in
# Build library
lib_LTLIBRARIES = libcollection.la
@@ -71,3 +71,30 @@ tests: all $(check_PROGRAMS)
clean-local:
rm -Rf doc
+
+
+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/libcollection.spec $(RPMBUILD)/SPECS
+ cp $(distdir).tar.gz $(RPMBUILD)/SOURCES
+ cd $(RPMBUILD); \
+ rpmbuild --define "_topdir $(RPMBUILD)" -ba SPECS/libcollection.spec
+
+# make srpms will use the old digest algorithm to be compatible
+# with RHEL5
+srpm: dist-gzip rpmroot
+ cp $(builddir)/contrib/libcollection.spec $(RPMBUILD)/SPECS
+ cp $(distdir).tar.gz $(RPMBUILD)/SOURCES
+ cd $(RPMBUILD); \
+ rpmbuild --define "_topdir $(RPMBUILD)" \
+ --define _source_filedigest_algorithm=1 \
+ -bs SPECS/libcollection.spec
diff --git a/collection/configure.ac b/collection/configure.ac
index 21723d5..a994b44 100644
--- a/collection/configure.ac
+++ b/collection/configure.ac
@@ -38,5 +38,5 @@ AC_PATH_PROG([DOXYGEN], [doxygen], [false])
AM_CONDITIONAL([HAVE_DOXYGEN], [test x$DOXYGEN != xfalse ])
-AC_CONFIG_FILES([Makefile collection.cfg.doxy collection.pc])
+AC_CONFIG_FILES([Makefile collection.cfg.doxy collection.pc contrib/libcollection.spec])
AC_OUTPUT
diff --git a/collection/contrib/libcollection.spec.in b/collection/contrib/libcollection.spec.in
new file mode 100644
index 0000000..3625e59
--- /dev/null
+++ b/collection/contrib/libcollection.spec.in
@@ -0,0 +1,86 @@
+Name: @PACKAGE_NAME@
+Version: @PACKAGE_VERSION@
+Release: 0%{?dist}
+Summary: Collection data-type for C
+Group: Development/Libraries
+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
+BuildRequires: doxygen
+
+%description
+A data-type to collect data in a heirarchical structure for easy iteration
+and serialization
+
+%package devel
+Summary: Development files for libcollection
+Group: Development/Libraries
+Requires: libcollection = %{version}-%{release}
+License: LGPLv3+
+
+%description devel
+A data-type to collect data in a heirarchical structure for easy iteration
+and serialization
+
+%prep
+%setup -q
+
+%build
+%configure \
+ --disable-static \
+ --disable-rpath
+
+make %{?_smp_mflags} all docs
+
+%check
+make %{?_smp_mflags} check
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+make install DESTDIR=$RPM_BUILD_ROOT
+
+# Remove .la files created by libtool
+rm -f $RPM_BUILD_ROOT/%{_libdir}/libcollection.la
+
+# Remove document install script. RPM is handling this
+rm -f doc/html/installdox
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(-,root,root,-)
+%doc COPYING
+%doc COPYING.LESSER
+%{_libdir}/libcollection.so.2
+%{_libdir}/libcollection.so.2.0.0
+
+%files devel
+%defattr(-,root,root,-)
+%{_includedir}/collection.h
+%{_includedir}/collection_tools.h
+%{_includedir}/collection_queue.h
+%{_includedir}/collection_stack.h
+%{_libdir}/libcollection.so
+%{_libdir}/pkgconfig/collection.pc
+%doc doc/html/
+
+%post -p /sbin/ldconfig
+%postun -p /sbin/ldconfig
+
+%changelog
+* Wed Aug 11 2010 Stephen Gallagher <sgallagh@redhat.com> - @PACKAGE_VERSION@-0
+- Automated build of libcollection