build: Add RPM specification, fix DESTDIR usage on install step.

Submitted by Andrew J. Schorr <aschorr@telemetry-...com>.
ck_pring
Samy Al Bahra 13 years ago
parent 3fa28d9a95
commit d6e306a2e4

@ -30,12 +30,14 @@ install-headers:
install: all install-headers install: all install-headers
mkdir -p $(DESTDIR)/$(LIBRARY) || exit mkdir -p $(DESTDIR)/$(LIBRARY) || exit
cp src/libck.so $(DESTDIR)/$(LIBRARY)/libck.so.$(VERSION) || exit cp src/libck.so $(DESTDIR)/$(LIBRARY)/libck.so.$(VERSION) || exit
ln -s $(DESTDIR)/$(LIBRARY)/libck.so.$(VERSION) $(DESTDIR)/$(LIBRARY)/libck.so ln -s $(LIBRARY)/libck.so.$(VERSION) $(DESTDIR)/$(LIBRARY)/libck.so
ln -s $(DESTDIR)/$(LIBRARY)/libck.so.$(VERSION) $(DESTDIR)/$(LIBRARY)/libck.so.$(VERSION_MAJOR) ln -s $(LIBRARY)/libck.so.$(VERSION) $(DESTDIR)/$(LIBRARY)/libck.so.$(VERSION_MAJOR)
chmod 744 $(DESTDIR)/$(LIBRARY)/libck.so* || exit chmod 744 $(DESTDIR)/$(LIBRARY)/libck.so* || exit
mkdir -p $(DESTDIR)/$(PKGCONFIG_DATA) || exit mkdir -p $(DESTDIR)/$(PKGCONFIG_DATA) || exit
chmod 755 $(DESTDIR)/$(PKGCONFIG_DATA) chmod 755 $(DESTDIR)/$(PKGCONFIG_DATA)
cp build/ck.pc $(DESTDIR)/$(PKGCONFIG_DATA)/ck.pc || exit cp build/ck.pc $(DESTDIR)/$(PKGCONFIG_DATA)/ck.pc || exit
cp src/libck.a $(DESTDIR)/$(LIBRARY)/libck.a || exit
chmod 644 $(DESTDIR)/$(LIBRARY)/libck.a || exit
uninstall: uninstall:
rm -f $(DESTDIR)/$(LIBRARY)/libck.so* rm -f $(DESTDIR)/$(LIBRARY)/libck.so*

@ -0,0 +1,69 @@
Name: ck
Version: @VERSION@
Release: 0%{?dist}
Group: Development/Libraries
Summary: Concurrency Kit
License: Revised BSD License
URL: http://concurrencykit.org
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Source: http://concurrencykit.org/releases/ck-%{version}.tar.gz
%description
Concurrency Kit provides a plethora of concurrency primitives, safe memory
reclamation mechanisms and lock-less and lock-free data structures designed to
aid in the design and implementation of high performance concurrent systems. It
is designed to minimize dependencies on operating system-specific interfaces
and most of the interface relies only on a strict subset of the standard
library and more popular compiler extensions.
%package devel
Group: Development/Libraries
Summary: Header files and libraries for CK development
Requires: %{name} = %{version}-%{release}
%description devel
Concurrency Kit provides a plethora of concurrency primitives, safe memory
reclamation mechanisms and lock-less and lock-free data structures designed to
aid in the design and implementation of high performance concurrent systems. It
is designed to minimize dependencies on operating system-specific interfaces
and most of the interface relies only on a strict subset of the standard
library and more popular compiler extensions.
This package provides the libraries, include files, and other
resources needed for developing Concurrency Kit applications.
%prep
%setup -q
%build
CFLAGS=$RPM_OPT_FLAGS ./configure --libdir=%{_libdir} --includedir=%{_includedir}/%{name} --prefix=%{_prefix}
make %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT install
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%{_libdir}/libck.so
%{_libdir}/libck.so.@VERSION@
%{_libdir}/libck.so.@VERSION_MAJOR@
%files devel
%defattr(-,root,root)
%{_includedir}/%{name}/*.h
%{_includedir}/%{name}/*/*.h
%{_includedir}/%{name}/*/*/*.h
%{_libdir}/libck.a
%{_libdir}/pkgconfig/%{name}.pc
%post
/sbin/ldconfig
%postun
/sbin/ldconfig

4
configure vendored

@ -32,7 +32,7 @@ EXIT_SUCCESS=0
EXIT_FAILURE=1 EXIT_FAILURE=1
MAINTAINER='sbahra@repnop.org' MAINTAINER='sbahra@repnop.org'
VERSION='0.1.5' VERSION='0.1.6'
VERSION_MAJOR='0' VERSION_MAJOR='0'
BUILD="$PWD/build/ck.build" BUILD="$PWD/build/ck.build"
PREFIX=${PREFIX:-"/usr/local"} PREFIX=${PREFIX:-"/usr/local"}
@ -169,6 +169,7 @@ if test "$PROFILE"; then
generate build/ck.build.in build/ck.build generate build/ck.build.in build/ck.build
generate build/regressions.build.in build/regressions.build generate build/regressions.build.in build/regressions.build
generate build/ck.pc.in build/ck.pc generate build/ck.pc.in build/ck.pc
generate build/ck.spec.in build/ck.spec
generate Makefile.in Makefile generate Makefile.in Makefile
echo "success" echo "success"
generate_stdout generate_stdout
@ -392,6 +393,7 @@ printf "Generating build files..........."
generate build/ck.build.in build/ck.build generate build/ck.build.in build/ck.build
generate build/regressions.build.in build/regressions.build generate build/regressions.build.in build/regressions.build
generate build/ck.pc.in build/ck.pc generate build/ck.pc.in build/ck.pc
generate build/ck.spec.in build/ck.spec
generate Makefile.in Makefile generate Makefile.in Makefile
echo "success" echo "success"

Loading…
Cancel
Save