Skip to content

Commit

Permalink
Track scripts used for packaging (using the Opensuse Build Service).
Browse files Browse the repository at this point in the history
  • Loading branch information
poletti-marco committed Jul 27, 2014
1 parent 7193876 commit cc3a623
Show file tree
Hide file tree
Showing 8 changed files with 227 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ set(CMAKE_CXX_COMPILER "/usr/bin/clang++")
set(INSTALL_LIBRARY_DIR lib CACHE PATH "Installation directory for libraries")
set(INSTALL_INCLUDE_DIR include CACHE PATH "Installation directory for headers")

set(FRUIT_VERSION "0.9.1")

enable_testing()

add_subdirectory(src)
add_subdirectory(extras EXCLUDE_FROM_ALL)
add_subdirectory(doc EXCLUDE_FROM_ALL)
add_subdirectory(examples EXCLUDE_FROM_ALL)
add_subdirectory(tests EXCLUDE_FROM_ALL)
Expand Down
15 changes: 15 additions & 0 deletions extras/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

set(EXTRAS_FILES
debian.control
debian.rules
libfruit.dsc
libfruit.install
libfruit.spec
PKGBUILD
)

# This places configured files (build files with @FRUIT_VERSION@ replaced) in build/extras/built

foreach(F ${EXTRAS_FILES})
configure_file(${F} built/${F} @ONLY)
endforeach(F)
30 changes: 30 additions & 0 deletions extras/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Maintainer: Marco Poletti <[email protected]>
pkgname=libfruit
pkgver=@FRUIT_VERSION@
pkgrel=0
pkgdesc="Fruit is a dependency injection framework for C++."
url="https://github.com/google/fruit"
arch=('x86_64' 'i686')
license=('Apache')
depends=('cmake' 'gcc>=4.8.1')
optdepends=()
makedepends=()
conflicts=()
replaces=()
backup=()
install='libfruit.install'
source=("fruit-${pkgver}.tar.gz")
md5sums=('d66cc12861e105cc38e5b878776f9f79')

build() {
cd "${srcdir}/fruit-${pkgver}"
cmake -DCMAKE_INSTALL_PREFIX=/usr .
make
}

package() {
cd "${srcdir}/fruit-${pkgver}"
make DESTDIR="${pkgdir}" install
}

# vim:set ts=2 sw=2 et:
23 changes: 23 additions & 0 deletions extras/debian.control
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Source: libfruit
Section: devel
Priority: optional
Maintainer: Marco Poletti <[email protected]>
Build-Depends: debhelper (>= 4.1.16), cmake, gcc-4.8 (>= 4.8.1)

Package: libfruit
Architecture: any
Depends: ${shlibs:Depends}
Description: Dependency Injection Framework For C++
Fruit is a dependency injection framework for C++, loosely inspired by the
Guice framework for Java.
It uses C++ metaprogramming together with some new C++11 features to detect
most injection problems at compile-time.

Package: fruit-dev
Architecture: any
Depends: ${shlibs:Depends}, libfruit
Description: Dependency Injection Framework For C++ - Development files
Fruit is a dependency injection framework for C++, loosely inspired by the
Guice framework for Java.
It uses C++ metaprogramming together with some new C++11 features to detect
most injection problems at compile-time.
77 changes: 77 additions & 0 deletions extras/debian.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
#!/usr/bin/make -f

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# This is the debhelper compatibility version to use.
export DH_COMPAT=4

CFLAGS = -g
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2
endif

build: build-stamp
build-stamp:
dh_testdir

cmake -DCMAKE_INSTALL_PREFIX=/usr
make all

touch build-stamp

clean:
dh_testdir
dh_testroot
rm -f build-stamp

make clean || true

dh_clean

install: build
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs

make install DESTDIR=/usr/src/packages/BUILD/debian/libfruit

# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.

# Build architecture-dependent files here.
binary-arch: build install
dh_testdir
dh_testroot
# dh_installdebconf
dh_installdocs
dh_installexamples
dh_installmenu
# dh_installlogrotate
# dh_installemacsen
# dh_installpam
# dh_installmime
# dh_installinit
dh_installcron
dh_installman
dh_installinfo
# dh_undocumented
dh_installchangelogs
dh_link
dh_strip
dh_compress
dh_fixperms
# dh_makeshlibs
dh_installdeb
# dh_perl
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install
10 changes: 10 additions & 0 deletions extras/libfruit.dsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Format: 1.0
Source: libfruit
Version: @FRUIT_VERSION@-0
Binary: libfruit
Maintainer: Marco Poletti <[email protected]>
Architecture: any
Build-Depends: debhelper (>= 4.1.16), cmake, gcc-4.8 (>= 4.8.1)
Files:
d57283ebb8157ae919762c58419353c8 133282 libfruit_@[email protected]
2fecf324a32123b08cefc0f047bca5ee 63176 libfruit_@[email protected]
1 change: 1 addition & 0 deletions extras/libfruit.install
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Intentionally empty
68 changes: 68 additions & 0 deletions extras/libfruit.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#
# spec file for package fruit
#

Name: libfruit
Version: @FRUIT_VERSION@
Release: 0
Summary: Dependency Injection Framework For C++
License: Apache-2.0
Group: Development/Libraries/C and C++
Url: https://github.com/google/fruit
Source0: fruit-%{version}.tar.gz

BuildRequires: cmake

%if 0%{?fedora_version} || 0%{?rhel_version} || 0%{?centos_version}
BuildRequires: gcc-c++ >= 4.8.1
%else
# OpenSUSE doesn't include the bugfix release version component in the package version.
BuildRequires: gcc-c++ >= 4.8
%endif

BuildRoot: %{_tmppath}/%{name}-%{version}-build

%description
Fruit is a dependency injection framework for C++, loosely inspired by the
Guice framework for Java.
It uses C++ metaprogramming together with some new C++11 features to detect
most injection problems at compile-time.

%package devel
Summary: Dependency Injection Framework For C++ - Development Files
License: Apache-2.0
Group: Development/Libraries/C and C++
Url: https://github.com/google/fruit
Requires: libfruit = %{version}

%description devel
Fruit is a dependency injection framework for C++, loosely inspired by the
Guice framework for Java.
It uses C++ metaprogramming together with some new C++11 features to detect
most injection problems at compile-time.

%prep
%setup -q -n fruit-%{version}

%build
cmake -DCMAKE_INSTALL_PREFIX=%{_prefix}

%{__make} %{?jobs:-j%jobs}

%install
%{__make} DESTDIR=%{buildroot} install

# TODO: Remove when upgrading to fruit > 0.9.1.
mv %{buildroot}/usr/lib/libfruit* .
mkdir -p %{buildroot}/%{_libdir}/
mv libfruit* %{buildroot}/%{_libdir}/

%files
%defattr(-,root,root)
%{_libdir}/libfruit.*

%files devel
%defattr(-,root,root)
%{_includedir}/fruit

%changelog

0 comments on commit cc3a623

Please sign in to comment.