From 0e76769c1be43fed1ad1ce32c90ca56b84af903a Mon Sep 17 00:00:00 2001 From: Andrei Belov Date: Tue, 23 Oct 2018 10:30:28 +0300 Subject: Packages: introduced unit-dev/unit-devel package. --- pkg/deb/debian/control | 8 ++++++++ pkg/deb/debian/rules.in | 8 ++++++++ pkg/rpm/unit.spec.in | 20 +++++++++++++++++++- 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/pkg/deb/debian/control b/pkg/deb/debian/control index e1b1bde8..c0873a1c 100644 --- a/pkg/deb/debian/control +++ b/pkg/deb/debian/control @@ -29,3 +29,11 @@ Depends: unit (= ${binary:Version}), ${misc:Depends} Description: NGINX Unit (debug symbols) This package contains the debugging symbols for NGINX Unit. + +Package: unit-dev +Section: libdevel +Priority: optional +Architecture: any +Depends: ${misc:Depends} +Description: NGINX Unit (development files) + Library and include files required for NGINX Unit modules development. diff --git a/pkg/deb/debian/rules.in b/pkg/deb/debian/rules.in index a9f68189..7eab391d 100644 --- a/pkg/deb/debian/rules.in +++ b/pkg/deb/debian/rules.in @@ -9,9 +9,12 @@ export DEB_LDFLAGS_MAINT_APPEND=-Wl,--as-needed -pie DPKG_EXPORT_BUILDFLAGS = 1 include /usr/share/dpkg/buildflags.mk +DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) + BUILDDIR_unit = $(CURDIR)/debian/build-unit BUILDDIR_unit_debug = $(CURDIR)/debian/build-unit-debug INSTALLDIR = $(CURDIR)/debian/unit +INSTALLDIR_dev = $(CURDIR)/debian/unit-dev BASEDIR = $(CURDIR) DOTESTS = 0 @@ -30,6 +33,7 @@ configure.unit: config.env.unit CFLAGS= ./configure \ %%CONFIGURE_ARGS%% \ --modules=/usr/lib/unit/modules \ + --libdir=/usr/lib/$(DEB_HOST_MULTIARCH) \ --cc-opt="$(CFLAGS)" \ --ld-opt="$(LDFLAGS)" touch $@ @@ -39,6 +43,7 @@ configure.unit_debug: config.env.unit_debug CFLAGS= ./configure \ %%CONFIGURE_ARGS%% \ --modules=/usr/lib/unit/debug-modules \ + --libdir=/usr/lib/$(DEB_HOST_MULTIARCH) \ --cc-opt="$(CFLAGS)" \ --ld-opt="$(LDFLAGS)" \ --debug @@ -47,6 +52,7 @@ configure.unit_debug: config.env.unit_debug build-arch.%: configure.% dh_testdir $(MAKE) -C $(BUILDDIR_$*) + $(MAKE) -C $(BUILDDIR_$*) build/libunit.a ifeq ($(DOTESTS), 1) $(MAKE) -C $(BUILDDIR_$*) tests endif @@ -86,7 +92,9 @@ install: build do.tests dh_installinit dh_installlogrotate cd $(BUILDDIR_unit) && DESTDIR=$(INSTALLDIR) make install + cd $(BUILDDIR_unit) && DESTDIR=$(INSTALLDIR_dev) make libunit-install install -m 755 $(BUILDDIR_unit_debug)/build/unitd $(INSTALLDIR)/usr/sbin/unitd-debug + install -m 644 $(BUILDDIR_unit_debug)/build/libunit.a $(INSTALLDIR_dev)/usr/lib/$(DEB_HOST_MULTIARCH)/libunit-debug.a mkdir -p $(INSTALLDIR)/usr/share/doc/unit/examples install -m 644 debian/unit.example.config $(INSTALLDIR)/usr/share/doc/unit/examples/example.config install -m 644 CHANGES $(INSTALLDIR)/usr/share/doc/unit/ diff --git a/pkg/rpm/unit.spec.in b/pkg/rpm/unit.spec.in index cdecaeac..e3523cb3 100644 --- a/pkg/rpm/unit.spec.in +++ b/pkg/rpm/unit.spec.in @@ -60,6 +60,14 @@ dynamically via an API. %debug_package %endif +%package devel +Summary: NGINX Unit (development files) +Version: %%VERSION%% +Release: %%RELEASE%%%{?dist}.ngx +Group: Development/Libraries +%description devel +Library and include files required for NGINX Unit modules development. + %prep %setup -q @@ -67,14 +75,17 @@ dynamically via an API. ./configure \ %{CONFIGURE_ARGS} \ --modules=%{_libdir}/unit/debug-modules \ + --libdir=%{_libdir} \ --cc-opt="%{CC_OPT}" \ --ld-opt="%{LD_OPT}" \ --debug %{__make} %{?_smp_mflags} +%{__make} %{?_smp_mflags} build/libunit.a %{__mv} build build-debug ./configure \ %{CONFIGURE_ARGS} \ --modules=%{_libdir}/unit/modules \ + --libdir=%{_libdir} \ --cc-opt="%{CC_OPT}" \ --ld-opt="%{LD_OPT}" %{__make} %{?_smp_mflags} @@ -83,9 +94,11 @@ dynamically via an API. %install %{__rm} -rf %{buildroot} %{__ln_s} build-nodebug build -DESTDIR=%{buildroot} make unitd-install +DESTDIR=%{buildroot} make unitd-install libunit-install %{__install} -m755 %{bdir}/build-debug/unitd \ %{buildroot}%{_sbindir}/unitd-debug +%{__install} -m644 %{bdir}/build-debug/libunit.a \ + %{buildroot}%{_libdir}/libunit-debug.a %{__mkdir} -p %{buildroot}%{_libdir}/unit/modules %{__mkdir} -p %{buildroot}%{_libdir}/unit/debug-modules %{__mkdir} -p %{buildroot}%{_sharedstatedir}/unit @@ -184,4 +197,9 @@ fi %dir %{_libdir}/unit/debug-modules %dir %{_sharedstatedir}/unit +%files devel +%{_libdir}/libunit.a +%{_libdir}/libunit-debug.a +%{_includedir}/nxt_*.h + %changelog -- cgit