Browse Source

PROJECT: Add rules for building Debian packages.

pull/567/head
Fredrik Roubert 15 years ago
committed by Mihaela Rosca
parent
commit
b5a2505a03
10 changed files with 163 additions and 5 deletions
  1. +10
    -5
      cpp/CMakeLists.txt
  2. +5
    -0
      debian/changelog
  3. +1
    -0
      debian/compat
  4. +50
    -0
      debian/control
  5. +28
    -0
      debian/copyright
  6. +3
    -0
      debian/libphonenumber-dev.install
  7. +1
    -0
      debian/libphonenumber-java.jlibs
  8. +1
    -0
      debian/libphonenumber3.install
  9. +63
    -0
      debian/rules
  10. +1
    -0
      debian/source/format

+ 10
- 5
cpp/CMakeLists.txt View File

@ -17,6 +17,8 @@
cmake_minimum_required (VERSION 2.8)
project (libphonenumber)
set (libphonenumber_VERSION_MAJOR 3)
set (libphonenumber_VERSION_MINOR 8)
# Helper functions dealing with finding libraries and programs this library
# depends on.
@ -260,8 +262,11 @@ if (BUILD_SHARED_LIB)
add_library (phonenumber-shared SHARED ${SOURCES})
add_dependencies (phonenumber-shared generate-sources ${METADATA_TARGET})
set_target_properties (phonenumber-shared
PROPERTIES OUTPUT_NAME "phonenumber")
set_target_properties (phonenumber-shared PROPERTIES PREFIX "lib")
PROPERTIES
OUTPUT_NAME "phonenumber"
PREFIX "lib"
SOVERSION ${libphonenumber_VERSION_MAJOR}
VERSION ${libphonenumber_VERSION_MAJOR}.${libphonenumber_VERSION_MINOR})
endif ()
set (LIBRARY_DEPS ${PROTOBUF_LIB} ${ICU_LIB} ${Boost_LIBRARIES})
@ -302,6 +307,7 @@ target_link_libraries (
libphonenumber_test
phonenumber_testing ${GTEST_LIB} pthread
)
add_custom_target(test COMMAND libphonenumber_test DEPENDS libphonenumber_test)
# Install rules.
install (FILES
@ -317,10 +323,9 @@ install (FILES
DESTINATION include/base/
)
install (FILES src/base/memory/singleton.h
DESTINATION include/base/memory)
DESTINATION include/base/memory/)
install (FILES src/base/synchronization/lock.h
DESTINATION include/base/synchronization)
DESTINATION include/base/synchronization/)
install (TARGETS phonenumber LIBRARY DESTINATION lib/ ARCHIVE DESTINATION lib/)


+ 5
- 0
debian/changelog View File

@ -0,0 +1,5 @@
libphonenumber (3.8) unstable; urgency=low
* Initial Debian Package.
-- Fredrik Roubert <roubert@google.com> Tue, 16 Aug 2011 16:11:46 +0200

+ 1
- 0
debian/compat View File

@ -0,0 +1 @@
7

+ 50
- 0
debian/control View File

@ -0,0 +1,50 @@
Source: libphonenumber
Priority: optional
Maintainer: Fredrik Roubert <roubert@google.com>
Build-Depends: ant,
cmake,
debhelper (>= 7.0.50~),
default-jdk | java-sdk,
javahelper (>= 0.34),
libboost-dev (>= 1.40),
libboost-thread-dev (>= 1.40),
libgtest-dev,
libicu-dev (>= 4.4),
libprotobuf-dev (>= 2.4),
libre2-dev,
protobuf-compiler
Standards-Version: 3.9.1
Section: libs
Homepage: http://code.google.com/p/libphonenumber/
Vcs-Browser: http://code.google.com/p/libphonenumber/source/browse/
Vcs-Svn: http://libphonenumber.googlecode.com/svn/trunk/
Package: libphonenumber-dev
Section: libdevel
Architecture: any
Depends: libphonenumber3 (=${binary:Version}), ${misc:Depends}
Description: parsing/formatting/validating phone numbers - development
Google's common C++ and Java library for parsing, formatting, storing and
validating international phone numbers.
.
This package contains the static libraries and include files.
Package: libphonenumber3
Section: libs
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: parsing/formatting/validating phone numbers - runtime
Google's common C++ and Java library for parsing, formatting, storing and
validating international phone numbers.
.
This package contains the runtime libraries.
Package: libphonenumber-java
Section: java
Architecture: all
Depends: ${java:Depends}, ${misc:Depends}
Description: parsing/formatting/validating phone numbers - java
Google's common C++ and Java library for parsing, formatting, storing and
validating international phone numbers.
.
This package contains the JAR files.

+ 28
- 0
debian/copyright View File

@ -0,0 +1,28 @@
This work was packaged for Debian by:
Fredrik Roubert <roubert@google.com> on Tue, 16 Aug 2011 16:11:46 +0200
It was downloaded from:
http://code.google.com/p/libphonenumber/
Copyright:
Copyright (C) 2011 The Libphonenumber Authors
License:
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
On Debian systems, the complete text of the Apache License, Version 2.0
can be found in `/usr/share/common-licenses/Apache-2.0'.

+ 3
- 0
debian/libphonenumber-dev.install View File

@ -0,0 +1,3 @@
usr/include/*
usr/lib/lib*.a
usr/lib/lib*.so

+ 1
- 0
debian/libphonenumber-java.jlibs View File

@ -0,0 +1 @@
java/build/jar/libphonenumber.jar

+ 1
- 0
debian/libphonenumber3.install View File

@ -0,0 +1 @@
usr/lib/lib*.so.*

+ 63
- 0
debian/rules View File

@ -0,0 +1,63 @@
#!/usr/bin/make -f
# -*- makefile -*-
# Copyright (C) 2011 The Libphonenumber Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
ANT ?= ant
CMAKE ?= cmake
JAVA_HOME ?= /usr/lib/jvm/default-java
CMAKE_FLAGS := -DCMAKE_INSTALL_PREFIX=/usr
CPP_BUILD := cpp/build
JAVA_BUILD := java/build
ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2
endif
ifeq (,$(filter nostrip,$(DEB_BUILD_OPTIONS)))
INSTALL_PROGRAM += -s
endif
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
MAKEFLAGS += -j$(NUMJOBS)
endif
%:
dh $@ --with javahelper
override_dh_auto_configure:
mkdir -p $(CPP_BUILD) && cd $(CPP_BUILD) && $(CMAKE) $(CMAKE_FLAGS) ..
override_dh_auto_build:
$(MAKE) -C $(CPP_BUILD) phonenumber phonenumber-shared
$(ANT) -f $(JAVA_BUILD).xml jar
override_dh_auto_test:
ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
$(MAKE) -C $(CPP_BUILD) test
$(ANT) -f $(JAVA_BUILD).xml junit
endif
override_dh_auto_install:
dh_auto_install --builddirectory=$(CPP_BUILD)
override_dh_auto_clean:
-test -d $(CPP_BUILD) && $(MAKE) -C $(CPP_BUILD) clean
-$(ANT) -f $(JAVA_BUILD).xml clean

+ 1
- 0
debian/source/format View File

@ -0,0 +1 @@
3.0 (native)

Loading…
Cancel
Save