Skip to content
Browse files

rulesformat option added

  • Loading branch information...
1 parent 2ccc02d commit 33c68d97e88d52be228c23e9bc202dda97c554dd csmall committed Jun 19, 2010
View
3 debian/changelog
@@ -1,6 +1,7 @@
dh-make (0.56) unstable; urgency=low
- * Put old rules files in, as an option
+ * cdbs is no longer a package type by a rules format
+ * New option rulesformat or -r which can be dh7,old or cdbs
-- Craig Small <csmall@debian.org> Wed, 16 Jun 2010 22:55:13 +1000
View
47 dh_make
@@ -16,10 +16,12 @@ $Getopt::Long::autoabbrev = 0;
# Some important parameters
our $DHLIB="/usr/share/debhelper/dh_make";
our $POLICY_VERSION="3.8.4";
-our $DH_MAKE_VERSION="0.56";
+our $DH_MAKE_VERSION="0.57";
my %PACKAGE_TYPES = ( 's' => 'Single', 'l' => 'Library',
- 'm' => 'Multi-Binary', 'k' => 'Kernel Module', 'b' => 'cdbs',
+ 'm' => 'Multi-Binary', 'k' => 'Kernel Module',
'n' => 'Kernel Patch', 'i' => 'Independent' );
+my %rules_formatS = ('7' => 'Debhelper v7+', 'old' => 'old debhelper',
+ 'c' => 'cdbs');
our $DASHLINE="";
@@ -30,6 +32,7 @@ our $package_name="";
our $cap_package_name="";
our $version="";
our $fullname = "";
+our $rules_format = "";
our $source_file="";
our $debian_native = 0;
our $copy_dir_for_orig = 0;
@@ -146,19 +149,20 @@ sub show_help
-e, --email <address> use <address> as the maintainer e-mail address
-n, --native the program is Debian native, don\'t generate .orig
-f, --file <file> specify file to use as the original source archive
- -r, --createorig make a copy for the original source archive
+ --createorig make a copy for the original source archive
-s, --single set package class to single
-i, --indep set package class to arch-independent
-m, --multi set package class to multiple binary
-l, --library set package class to library
-k, --kmod set package class to kernel module
--kpatch set package class to kernel patch
- -b, --cdbs set package class to cdbs
-a, --addmissing reprocess package and add missing files
-t, --templates <dir> apply customizing templates in <dir>
-d --defaultless skip the default debian and package class templates
-o, --overlay <dir> reprocess package using template in <dir>
-p, --packagename <name> force package name to be <name>
+ -r, --ruleformat <fmt> Set the format of debian/rules file
+ (old|dh7|cdbs)
-h, --help display this help screen and exit
-v, --version show the version and exit
@@ -170,13 +174,13 @@ EOF
sub parse_args
{
- my ($dohelp,$doversion, $single,$indep,$multi,$library,$kmod,$kpatch,$cdbs );
+ my ($dohelp,$doversion, $single,$indep,$multi,$library,$kmod,$kpatch);
if (GetOptions(
'copyright|c=s' => \$main::license,
'dpatch' => \$dpatch,
'email|e=s' => \$main::email,
'file|f=s' => \$main::source_file,
- 'createorig|r' => \$main::copy_dir_for_orig,
+ 'createorig' => \$main::copy_dir_for_orig,
'help|h' => \$dohelp,
'version|v' => \$doversion,
'native|n' => \$main::debian_native,
@@ -186,8 +190,8 @@ sub parse_args
'library|l' => \$library,
'kmod|k' => \$kmod,
'kpatch' => \$kpatch,
- 'cdbs|b' => \$cdbs,
'addmissing|a' => \$main::add_missing,
+ 'ruleformat|r' => \$main::rules_format,
'templates|t=s' => \$main::custom,
'defaultless|d' => \$main::no_defaults,
'overlay|o=s' => \$main::overlay,
@@ -238,10 +242,6 @@ sub parse_args
{
$main::package_type = 'n';
}
- if ($cdbs)
- {
- $main::package_type = 'b';
- }
$main::license = lc $main::license;
if ($main::license ne "" && !($main::license =~ /^(gpl|gpl2|gpl3|lgpl|lgpl2|lgpl3|artistic|bsd|blank|apache)$/))
{
@@ -251,6 +251,19 @@ sub parse_args
# Change the non-versioned into the latest version
$main::license = "gpl3" if ($main::license eq "gpl");
$main::license = "lgpl3" if ($main::license eq "lgpl");
+
+ # Verifuly ruletype
+ $main::rules_format = lc $main::rules_format;
+ if ($main::rules_format eq "")
+ {
+ $main::rules_format = "v7";
+ } else {
+ if ($main::rules_format !~ /^(v7|old|cdbs)$/)
+ {
+ print "Rule Format \"$main::rules_format\" is not v7, old or cdbs.\n";
+ exit;
+ }
+ }
}
sub get_username
@@ -744,6 +757,18 @@ if ( $custom ne "" )
}
}
+if ( -f "rules")
+{
+ print "File rules already exists, skipping.\n";
+} else {
+ if ( ! -f "rules.$rules_format")
+ {
+ print "Cannot find rules file for rules format \"$rules_format\".\n";
+ exit;
+ }
+ system('mv', "rules.$rules_format", "rules");
+}
+
# kernel-patch kpatch file name
rename "kpatches", "$package_name.kpatches" if $package_type eq "n";
View
17 dh_make.1
@@ -1,15 +1,16 @@
-.TH DH_MAKE 8 "1 February 2010" "Debian Project" \" -*- nroff -*-
+.TH DH_MAKE 8 "19 June 2010" "Debian Project" \" -*- nroff -*-
.SH NAME
dh_make \- prepare Debian packaging for an original source archive
.SH SYNOPSIS
.B dh_make
-[\-bnlsmiadh] [\-c license] [\-e address] [\-f file] [\-t directory]
+[\-nlsmiadhr] [\-c license] [\-e address] [\-f file] [\-t directory]
[\-o directory] [\-p name] [\-\-copyright license]
[\-\-email address] [\-\-native] [\-\-file file]
[\-\-library] [\-\-single] [\-\-indep] [\-\-multi] [\-\-kmod] [\-\-kpatch]
[\-\-addmissing]
[\-\-templates directory] [\-\-defaultless] [\-\-overlay directory]
[\-\-packagename name] [\-\-dpatch]
+[\-\-rulesformat format]
[\-\-help] [\-\-version]
.SH DESCRIPTION
.B dh_make
@@ -47,10 +48,6 @@ The package will generate a binary\-all kernel module \-source package for
use with the make\-kpkg command. It also generates a binary package for
additional utilities, daemons, etc. that may come with the source.
.TP
-.B cdbs (b)
-The package will be build using the Common Debian Build System.
-CDBS provides a sane set of default rules upon which packages can build.
-.TP
.B Kernel patch
The package will generate a package that can be used for kernel patches.
.SH ACTIONS PERFORMED
@@ -141,9 +138,6 @@ Automatically set the package class to Multiple binary, skipping the question.
.I \-k, \-\-kmod
Automatically set the package class to Kernel module, skipping the question.
.TP
-.I \-b, \-\-cdbs
-Automatically set package class to cdbs, skipping the question.
-.TP
.I \-\-kpatch
Automatically set package class to kpatch, skipping the question.
.TP
@@ -174,6 +168,11 @@ The new package will use dpatch to manage patches. This option is deprecated
and will be removed in future versions of \fBdh\_make\fR. Use the quilt
patch system which is built into the source package.
.TP
+.I \-r, \-\-rulesformat <format>
+Set the format for the debian/rules file to <format>. The options are
+the default Debhelper v7 minimal rules (dh7), the old rules format (old)
+or CDBS format (cdbs).
+.TP
.I \-v, \-\-version
Show the program name and version, and exit successfully.
.SH ENVIRONMENT
View
15 lib/debianb/control
@@ -1,15 +0,0 @@
-Source: #PACKAGE#
-Section: unknown
-Priority: extra
-Maintainer: #USERNAME# <#EMAIL#>
-Build-Depends: #BUILD_DEPS#
-Standards-Version: #POLICY#
-Homepage: <insert the upstream URL, if relevant>
-#Vcs-Git: git://git.debian.org/collab-maint/#PACKAGE#.git
-#Vcs-Browser: http://git.debian.org/?p=collab-maint/#PACKAGE#.git;a=summary
-
-Package: #PACKAGE#
-Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}
-Description: <insert up to 60 chars description>
- <insert long description, indented with spaces>
View
23 lib/debianb/watch.ex
@@ -1,23 +0,0 @@
-# Example watch control file for uscan
-# Rename this file to "watch" and then you can run the "uscan" command
-# to check for upstream updates and more.
-# See uscan(1) for format
-
-# Compulsory line, this is a version 3 file
-version=3
-
-# Uncomment to examine a Webpage
-# <Webpage URL> <string match>
-#http://www.example.com/downloads.php #PACKAGE#-(.*)\.tar\.gz
-
-# Uncomment to examine a Webserver directory
-#http://www.example.com/pub/#PACKAGE#-(.*)\.tar\.gz
-
-# Uncommment to examine a FTP server
-#ftp://ftp.example.com/pub/#PACKAGE#-(.*)\.tar\.gz debian uupdate
-
-# Uncomment to find new files on sourceforge, for devscripts >= 2.9
-# http://sf.net/#PACKAGE#/#PACKAGE#-(.*)\.tar\.gz
-
-# Uncomment to find new files on GooglePages
-# http://example.googlepages.com/foo.html #PACKAGE#-(.*)\.tar\.gz
View
13 lib/debiani/rules
@@ -1,13 +0,0 @@
-#!/usr/bin/make -f
-# -*- makefile -*-
-# Sample debian/rules that uses debhelper.
-# This file was originally written by Joey Hess and Craig Small.
-# As a special exception, when this file is copied by dh-make into a
-# dh-make output file, you may use that output file without restriction.
-# This special exception was added by Craig Small in version 0.37 of dh-make.
-
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
-
-%:
- dh $@ #DH7_ADDON#
View
85 lib/debiani/rules.old.ex
@@ -1,85 +0,0 @@
-#!/usr/bin/make -f
-# -*- makefile -*-
-# Sample debian/rules that uses debhelper.
-# This file was originally written by Joey Hess and Craig Small.
-# As a special exception, when this file is copied by dh-make into a
-# dh-make output file, you may use that output file without restriction.
-# This special exception was added by Craig Small in version 0.37 of dh-make.
-
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
-
-
-#DPKG_ARCH#
-#PATCH_CLASS#
-
-#CONFIGURE#
-
-build: build-stamp
-
-build-stamp: #CONFIGURE_STAMP# #CONFIG_STATUS# #PATCH_STAMP#
- dh_testdir
-
- # Add here commands to compile the package.
- #MAKE#
- #docbook-to-man debian/#PACKAGE#.sgml > #PACKAGE#.1
-
- touch $@
-
-clean: #PATCH_CLEAN#
- dh_testdir
- dh_testroot
- rm -f build-stamp #CONFIGURE_STAMP#
-
- # Add here commands to clean up after the build process.
- #CLEAN#
-
- dh_clean#PRESERVE#
-
-install: build
- dh_testdir
- dh_testroot
- dh_prep #PRESERVE#
- dh_installdirs
-
- # Add here commands to install the package into debian/#PACKAGE#.
- #INSTALL#
-
-
-# Build architecture-independent files here.
-binary-indep: install
- dh_testdir
- dh_testroot
- dh_installchangelogs #CHANGELOGS#
- dh_installdocs
- dh_installexamples
-# dh_install
-# dh_installmenu
-# dh_installdebconf
-# dh_installlogrotate
-# dh_installemacsen
-# dh_installpam
-# dh_installmime
-# dh_installinit
-# dh_installcron
-# dh_installinfo
-# dh_installwm
-# dh_installudev
-# dh_lintian
-# dh_undocumented
- dh_installman
- dh_link
- dh_compress
- dh_fixperms
-# dh_perl
-# dh_python
- dh_installdeb
- dh_gencontrol
- dh_md5sums
- dh_builddeb
-
-# Build architecture-dependent files here.
-binary-arch: install
-
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install #PHONY_CONFIGURE#
View
0 lib/debiank/rules → lib/debiank/rules.dh7
File renamed without changes.
View
0 lib/debiank/rules.old.ex → lib/debiank/rules.old
File renamed without changes.
View
0 lib/debianm/rules → lib/debianm/rules.dh7
File renamed without changes.
View
0 lib/debianm/rules.old.ex → lib/debianm/rules.old
File renamed without changes.
View
0 lib/debiann/rules → lib/debiann/rules.dh7
File renamed without changes.
View
0 lib/debiann/rules.old.ex → lib/debiann/rules.old
File renamed without changes.
View
13 lib/debians/rules
@@ -1,13 +0,0 @@
-#!/usr/bin/make -f
-# -*- makefile -*-
-# Sample debian/rules that uses debhelper.
-# This file was originally written by Joey Hess and Craig Small.
-# As a special exception, when this file is copied by dh-make into a
-# dh-make output file, you may use that output file without restriction.
-# This special exception was added by Craig Small in version 0.37 of dh-make.
-
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
-
-%:
- dh $@ #DH7_ADDON#
View
0 lib/debianb/rules → lib/debians/rules.cdbs
File renamed without changes.
View
85 lib/debians/rules.old.ex
@@ -1,85 +0,0 @@
-#!/usr/bin/make -f
-# -*- makefile -*-
-# Sample debian/rules that uses debhelper.
-# This file was originally written by Joey Hess and Craig Small.
-# As a special exception, when this file is copied by dh-make into a
-# dh-make output file, you may use that output file without restriction.
-# This special exception was added by Craig Small in version 0.37 of dh-make.
-
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
-
-
-#DPKG_ARCH#
-#PATCH_CLASS#
-
-#CONFIGURE#
-
-build: build-stamp
-
-build-stamp: #CONFIGURE_STAMP# #CONFIG_STATUS# #PATCH_STAMP#
- dh_testdir
-
- # Add here commands to compile the package.
- #MAKE#
- #docbook-to-man debian/#PACKAGE#.sgml > #PACKAGE#.1
-
- touch $@
-
-clean: #PATCH_CLEAN#
- dh_testdir
- dh_testroot
- rm -f build-stamp #CONFIGURE_STAMP#
-
- # Add here commands to clean up after the build process.
- #CLEAN#
-
- dh_clean#PRESERVE#
-
-install: build
- dh_testdir
- dh_testroot
- dh_prep #PRESERVE#
- dh_installdirs
-
- # Add here commands to install the package into debian/#PACKAGE#.
- #INSTALL#
-
-
-# Build architecture-independent files here.
-binary-indep: install
-# We have nothing to do by default.
-
-# Build architecture-dependent files here.
-binary-arch: install
- dh_testdir
- dh_testroot
- dh_installchangelogs #CHANGELOGS#
- dh_installdocs
- dh_installexamples
-# dh_install
-# dh_installmenu
-# dh_installdebconf
-# dh_installlogrotate
-# dh_installemacsen
-# dh_installpam
-# dh_installmime
-# dh_python
-# dh_installinit
-# dh_installcron
-# dh_installinfo
- dh_installman
- dh_link
- dh_strip
- dh_compress
- dh_fixperms
-# dh_perl
-# dh_makeshlibs
- dh_installdeb
- dh_shlibdeps
- dh_gencontrol
- dh_md5sums
- dh_builddeb
-
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install #PHONY_CONFIGURE#

0 comments on commit 33c68d9

Please sign in to comment.
Something went wrong with that request. Please try again.