dh-rebar-0.0.4/0000755000000000000000000000000012245504043010064 5ustar dh-rebar-0.0.4/Makefile0000644000000000000000000000131712245500363011527 0ustar DH_REBAR_DIR=usr/share/dh-rebar/ DH_DIR=usr/share/perl5/Debian/Debhelper/ build: man/dh_rebar.1 clean: rm -rf man install: mkdir -p $(DESTDIR)/$(DH_REBAR_DIR)/template/ mkdir -p $(DESTDIR)/$(DH_REBAR_DIR)/make/ mkdir -p $(DESTDIR)/$(DH_DIR)/Buildsystem/ mkdir -p $(DESTDIR)/$(DH_DIR)/Sequence/ mkdir -p $(DESTDIR)/usr/bin/ cp template/* $(DESTDIR)/$(DH_REBAR_DIR)/template/ cp make/* $(DESTDIR)/$(DH_REBAR_DIR)/make/ cp debhelper7/Buildsystem/* $(DESTDIR)/$(DH_DIR)/Buildsystem/ cp debhelper7/Sequence/* $(DESTDIR)/$(DH_DIR)/Sequence/ cp bin/dh_rebar $(DESTDIR)/usr/bin/ man/dh_rebar.1: bin/dh_rebar @if [ ! -d man ] ; then mkdir man; fi pod2man -c "dh_rebar" -r "dh_rebar" bin/dh_rebar man/dh_rebar.1 dh-rebar-0.0.4/bin/0000755000000000000000000000000012245500363010635 5ustar dh-rebar-0.0.4/bin/dh_rebar0000755000000000000000000000102512245500363012327 0ustar #!/usr/bin/perl -w =head1 NAME dh_rebar - generate control file =cut use strict; use Debian::Debhelper::Dh_Lib; =head1 SYNOPSIS B [S>] =head1 DESCRIPTION B is a debhelper program that is responsible for generating control files using erlang-depends. =cut init(); foreach my $package (@{$dh{DOPACKAGES}}) { doit("erlang-depends", "-p$package"); } =head1 SEE ALSO L This program is a part of debhelper. =head1 AUTHOR Nobuhiro Iwamatsu =cut dh-rebar-0.0.4/debian/0000755000000000000000000000000012245504043011306 5ustar dh-rebar-0.0.4/debian/copyright0000644000000000000000000000257512245500363013253 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Files: debhelper7/Buildsystem/rebar.pm make/dh-rebar.Makefile Copyright: 2013 Nobuhiro Iwamatsu 2012 Enrico Tassi License: MIT/X Files: * Copyright: 2013 Nobuhiro Iwamatsu License: MIT/X License: MIT/X Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: . The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. . THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. dh-rebar-0.0.4/debian/control0000644000000000000000000000107112245500363012711 0ustar Source: dh-rebar Section: devel Priority: optional Maintainer: Nobuhiro Iwamatsu Build-Depends: debhelper (>= 8.0.0) Standards-Version: 3.9.4 Vcs-Git: git://anonscm.debian.org/pkg-leofs/dh-rebar.git Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-leofs/dh-rebar.git;a=summary Package: dh-rebar Architecture: all Depends: ${misc:Depends}, debhelper (>= 8.0.0), rebar Description: helper tools for maintaining Erlang package which is using rebar This package contains helper tools for maintaining Erlang Debian package which is using rebar. dh-rebar-0.0.4/debian/docs0000644000000000000000000000000712245500363012157 0ustar README dh-rebar-0.0.4/debian/changelog0000644000000000000000000000133212245501515013160 0ustar dh-rebar (0.0.4) unstable; urgency=low * Increased the information that is output by rebar. (Closes: #730340) -- Nobuhiro Iwamatsu Thu, 28 Nov 2013 08:37:06 +0900 dh-rebar (0.0.3) unstable; urgency=low * Fix control of default package name. * Fix control for naem of erlang package. -- Nobuhiro Iwamatsu Wed, 21 Aug 2013 09:07:23 +0900 dh-rebar (0.0.2) unstable; urgency=low * Fix Vcs-Git and Vcs-Browser field. * Change the turn of rebar_compile. -- Nobuhiro Iwamatsu Tue, 06 Aug 2013 08:32:18 +0900 dh-rebar (0.0.1) unstable; urgency=low * Initial release. -- Nobuhiro Iwamatsu Wed, 3 Apr 2013 00:55:01 +0900 dh-rebar-0.0.4/debian/source/0000755000000000000000000000000012245500363012607 5ustar dh-rebar-0.0.4/debian/source/format0000644000000000000000000000001512245500363014016 0ustar 3.0 (native) dh-rebar-0.0.4/debian/manpages0000644000000000000000000000000612245500363013021 0ustar man/* dh-rebar-0.0.4/debian/compat0000644000000000000000000000000212245500363012505 0ustar 7 dh-rebar-0.0.4/debian/rules0000755000000000000000000000006212245500363012365 0ustar #!/usr/bin/make -f #export DH_VERBOSE=1 %: dh $@ dh-rebar-0.0.4/template/0000755000000000000000000000000012245500363011700 5ustar dh-rebar-0.0.4/template/pkg.install.in0000644000000000000000000000026212245500363014456 0ustar test -d @@REBAR_BIN_DIR@@ && echo usr/lib/erlang/lib/@@E_PKG_NAME@@-@@PKG_VERSION@@/ebin test -d @@REBAR_LIB_DIR@@ && echo usr/lib/erlang/lib/@@E_PKG_NAME@@-@@PKG_VERSION@@/priv dh-rebar-0.0.4/template/dh-rebar.conf0000644000000000000000000000016312245500363014233 0ustar PKG_NAME= PKG_VERSION= EXEC_REBAR_COMMANDS=compile REBAR_LIB_DIR=priv REBAR_BIN_DIR=ebin REBAR_INCLUDE_DIR=include dh-rebar-0.0.4/template/dev.install.in0000644000000000000000000000014012245500363014446 0ustar test -d @@REBAR_INCLUDE_DIR@@ && echo usr/lib/erlang/lib/@@E_PKG_NAME@@-@@PKG_VERSION@@/include dh-rebar-0.0.4/debhelper7/0000755000000000000000000000000012245147411012107 5ustar dh-rebar-0.0.4/debhelper7/Sequence/0000755000000000000000000000000012245500363013656 5ustar dh-rebar-0.0.4/debhelper7/Sequence/rebar.pm0000644000000000000000000000040112245500363015302 0ustar #! /usr/bin/perl # Copyright: 2013 Nobuhiro iwamatsu # License: MIT/X # use warnings; use strict; use Debian::Debhelper::Dh_Lib; insert_before("dh_gencontrol", "dh_rebar"); add_command_options("dh_compress", "-X.erl -X.beam"); 1; dh-rebar-0.0.4/debhelper7/Buildsystem/0000755000000000000000000000000012245500363014412 5ustar dh-rebar-0.0.4/debhelper7/Buildsystem/rebar.pm0000644000000000000000000000230112245500363016037 0ustar # Copyright: © 2012 Enrico Tassi # Copyright: 2013 Nobuhiro iwamatsu # License: MIT/X # Strongly based on the ruby build systems. Thanks Lucas! package Debian::Debhelper::Buildsystem::rebar; use strict; use base 'Debian::Debhelper::Buildsystem'; my $DH_REBAR_MAKEFILE="/usr/share/dh-rebar/make/dh-rebar.Makefile"; sub DESCRIPTION { "rebar" } sub check_auto_buildable { return 0 } sub new { my $class=shift; my $this=$class->SUPER::new(@_); $this->enforce_in_source_building(); return $this; } sub configure { my $this=shift; $this->doit_in_sourcedir("make", "--no-print-directory", "-f", $DH_REBAR_MAKEFILE, "configure", @_); } sub build { my $this=shift; $this->doit_in_sourcedir("make", "--no-print-directory", "-f", $DH_REBAR_MAKEFILE, "build", @_); } sub test { my $this=shift; $this->doit_in_sourcedir("make", "--no-print-directory", "-f", $DH_REBAR_MAKEFILE, "test", @_); } sub install { my $this=shift; $this->doit_in_sourcedir("make", "--no-print-directory", "-f", $DH_REBAR_MAKEFILE, "install", @_); } sub clean { my $this=shift; $this->doit_in_sourcedir("make", "--no-print-directory", "-f", $DH_REBAR_MAKEFILE, "clean", @_); } 1 dh-rebar-0.0.4/README0000644000000000000000000000353412245500363010752 0ustar * What's this? This is debhelper support tool of the build tool rebar used by Erlang. This provides Buildsystem and Sequence of rebar, and dh_rebar program. * How do I use this? You can build the Erlang program using rebar to debian package, by writing debian/rules and debian/dh-rebar.conf. debian/rules: ----- #!/usr/bin/make -f %: dh $@ --buildsystem=rebar --with rebar ----- debian/dh-rebar.conf: ----- EXEC_REBAR_COMMANDS=compile ----- * About dh-rebar.conf * PKG_NAME: Set name of Erlang package. If you want to change debian-package name, you can use this. Usually, you do not need to specify this. * PKG_VERSION: Set version of Erlang package. If you do not want to use debian-package name, you can use this. Usually, you do not need to specify this. * EXEC_REBAR_COMMANDS: Set command of rebar. The command of rebar executed with your package is specified. When there are more than one, it separates by a space. For example, if your package does compile and a test, it specifies as follows. EXEC_REBAR_COMMANDS=compile eunit * REBAR_LIB_DIR: The place where a library etc. are installed is specified. Usually, although 'priv' is used, when installed in a different directory, please specify this using this. Usually, you do not need to specify this. * REBAR_BIN_DIR: The place where a Erlang binary. are installed is specified. Usually, although 'ebin' is used, when installed in a different directory, please specify this using this. Usually, you do not need to specify this. * REBAR_INCLUDE_DIR: The place where a Erlang binary. are installed is specified. Usually, although 'include' is used, when installed in a different directory, please specify this using this. Usually, you do not need to specify this. -- 2013-06-11 Nobuhiro Iwamatsu dh-rebar-0.0.4/make/0000755000000000000000000000000012245502230010775 5ustar dh-rebar-0.0.4/make/dh-rebar.Makefile0000644000000000000000000001105112245502230014116 0ustar # Copyright: $BB)(B 2012 Enrico Tassi # Copyright: 2013 Nobuhiro iwamatsu # License: MIT/X # override for verbose output ifeq "$(DH_VERBOSE)-" "-" H=@ else H= endif include debian/dh-rebar.conf # package name and version # PKG_NAME: package name (e.g. foo-bar) # DEB_PKG: Debian package name (Add erlang-. e.g. erlang-foo-bar) # E_PKG_NAME: Erlang package name (use unserscore instead of dash. e.g. foo_bar) ifeq "$(PKG_NAME)" "" PKG_NAME=$(shell dpkg-parsechangelog | sed -rne 's/^Source: erlang-(.*)/\1/p') DEB_PKG=erlang-$(PKG_NAME) else DEB_PKG=$(PKG_NAME) endif E_PKG_NAME=$(shell echo $(PKG_NAME) | sed -e 's/-/_/g') DEB_PKG_DEV=$(DEB_PKG)-dev ifeq "$(PKG_VERSION)" "" PKG_VERSION=$(shell dpkg-parsechangelog | sed -rne 's/^Version: ([0-9.]+)(\+dfsg)?.*$$/\1/p') endif ifeq "$(REBAR_INCLUDE_DIR)" "" REBAR_INCLUDE_DIR=include endif ifeq "$(REBAR_LIB_DIR)" "" REBAR_LIB_DIR=priv endif ifeq "$(REBAR_BIN_DIR)" "" REBAR_BIN_DIR=ebin endif # CFLAGS CFLAGS := $(shell dpkg-buildflags --get CFLAGS) CFLAGS += $(shell dpkg-buildflags --get CPPFLAGS) STD_LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS) LDFLAGS = $(STD_LDFLAGS) $(CLIB_LDFLAGS) # .install DH_REBAR_SUPPORT_FILES=/usr/share/dh-rebar/ DEB_INST_PKG=debian/$(DEB_PKG).install DEB_INST_PKG_TEMPL=$(DH_REBAR_SUPPORT_FILES)template/pkg.install.in DEB_INST_DEV=debian/$(DEB_PKG_DEV).install DEB_INST_DEV_TEMPL=$(DH_REBAR_SUPPORT_FILES)template/dev.install.in # macros define subst_vars sed \ -e 's/@@PKG_VERSION@@/$(PKG_VERSION)/g' \ -e 's/@@E_PKG_NAME@@/$(E_PKG_NAME)/g' \ -e 's/@@REBAR_LIB_DIR@@/$(REBAR_LIB_DIR)/g' \ -e 's/@@REBAR_BIN_DIR@@/$(REBAR_BIN_DIR)/g' \ -e 's/@@REBAR_INCLUDE_DIR@@/$(REBAR_INCLUDE_DIR)/g' \ -e '/^test /e' endef define trash echo $(1) >> debian/trash endef define empty_trash if [ -e debian/trash ]; then \ $(RM) -f `cat debian/trash`; fi endef define merge_with (while read line; do\ [ -e $(1) ] || touch $(1);\ if grep -q -F "$$line" $(1); then\ echo "Skipping already existing line: $$line";\ else\ echo "Adding new line: $$line";\ echo "$$line" >> $(1);\ fi;\ done) endef .PHONY: build clean test install configure clean_debhelper: $(H)$(call empty_trash) $(H)$(RM) -rf debian/trash # build ifneq (,$(findstring compile, $(EXEC_REBAR_COMMANDS))) BUILD_TARGET=rebar_compile endif ifneq (,$(findstring xref, $(EXEC_REBAR_COMMANDS))) BUILD_TARGET+=rebar_xref endif ifneq (,$(findstring doc, $(EXEC_REBAR_COMMANDS))) BUILD_TARGET+=rebar_doc endif build: $(BUILD_TARGET) # test ifneq (,$(findstring eunit, $(EXEC_REBAR_COMMANDS))) TEST_TARGET=rebar_eunit endif test: $(TEST_TARGET) configure: clean: clean_debhelper $(H)echo $@ rebar clean skip_deps=true -vv $(H)rm -rf ebin/*.beam $(H)rm -rf ebin/*.app $(H)rm -rf c_src/*.o $(H)rm -rf priv/.so $(H)rm -rf .eunit rebar_compile: $(H)echo $@ rebar compile skip_deps=true -vv rebar_xref: $(H)echo $@ rebar xref skip_deps=true -vv rebar_doc: $(H)echo $@ rebar doc skip_deps=true -vv rebar_eunit: $(H)@echo $@ rebar eunit skip_deps=true -vv install: $(H)echo $@ $(H)$(call trash, $(DEB_INST_PKG)) $(H)if [ -e $(DEB_INST_PKG).in ]; then\ echo "Filling in $(DEB_INST_PKG) using $(DEB_INST_PKG).in";\ cat $(DEB_INST_PKG).in | $(call subst_vars) | \ $(call merge_with, $(DEB_INST_PKG));\ else \ echo "Filling in $(DEB_INST_PKG) using $(DEB_INST_PKG_TEMPL)";\ cat $(DEB_INST_PKG_TEMPL) | $(call subst_vars) | \ $(call merge_with, $(DEB_INST_PKG));\ fi $(H)$(call trash, $(DEB_INST_DEV)) $(H)if [ -e $(DEB_INST_DEV).in ]; then\ echo "Filling in $(DEB_INST_DEV) using $(DEB_INST_DEV).in";\ cat $(DEB_INST_DEV).in | $(call subst_vars) | \ $(call merge_with, $(DEB_INST_DEV));\ else \ echo "Filling in $(DEB_INST_DEV) using $(DEB_INST_DEV_TEMPL)";\ cat $(DEB_INST_DEV_TEMPL) | $(call subst_vars) | \ $(call merge_with, $(DEB_INST_DEV));\ fi $(H)install -d \ debian/tmp/usr/lib/erlang/lib/$(E_PKG_NAME)-$(PKG_VERSION)/ebin $(H)install -m 644 ebin/* \ debian/tmp/usr/lib/erlang/lib/$(E_PKG_NAME)-$(PKG_VERSION)/ebin/ $(H)if [ -e include ]; then \ install -d \ debian/tmp/usr/lib/erlang/lib/$(E_PKG_NAME)-$(PKG_VERSION)/include ;\ install -m 644 include/* \ debian/tmp/usr/lib/erlang/lib/$(E_PKG_NAME)-$(PKG_VERSION)/include/;\ fi $(H)if [ -e priv ]; then \ install -d \ debian/tmp/usr/lib/erlang/lib/$(E_PKG_NAME)-$(PKG_VERSION)/priv ;\ install -m 644 priv/* \ debian/tmp/usr/lib/erlang/lib/$(E_PKG_NAME)-$(PKG_VERSION)/priv/ ;\ rm -rf debian/tmp/usr/lib/erlang/lib/$(E_PKG_NAME)-$(PKG_VERSION)/priv/Run-eunit-loop.expect ;\ fi