Skip to content

Commit 118edd5

Browse files
committed
* add debianlize helper.
1 parent 25e5f00 commit 118edd5

File tree

10 files changed

+135
-1
lines changed

10 files changed

+135
-1
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
*egg-info*
55
build
66
dist
7+
bdist

LICENSE COPYING

File renamed without changes.

README

+9-1
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,18 @@ run with graphic (with -a option if you running firstly)
1313

1414
user@host# glzs -a
1515

16-
run with last selection
16+
run with last selection
1717

1818
user@host# glzs --selection last_selection.ini
1919

20+
== Build Deb
21+
22+
user@host# ./scripts/build_deb $tagname
23+
24+
for example
25+
26+
user@host# ./scripts/build_deb v0.2rc4
27+
2028
== More
2129

2230
Project Home: http://www.lazyscripts.org

data/debian_template/changelog

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
lazyscripts (0.2.rc3~karmic) karmic; urgency=low
2+
3+
* Initial Release.
4+
5+
-- Hsin Yi Chen (hychen) <[email protected]> Sun, 21 Mar 2010 17:38:42 +0800

data/debian_template/compat

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
7

data/debian_template/control

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Source: lazyscripts
2+
Section: utils
3+
Priority: optional
4+
Maintainer: Hsin Yi Chen (hychen) <[email protected]>
5+
Build-Depends:
6+
cdbs,
7+
debhelper (>= 7),
8+
python,
9+
python-support,
10+
python-setuptools,
11+
python-distutils-extra
12+
Standards-Version: 3.8.3
13+
Homepage: http://www.lazyscripts.org
14+
15+
Package: lazyscripts
16+
Architecture: all
17+
Depends: python (>=2.6), python-gtk2, python-vte, git, zenity, sudo, gksu
18+
Description: A stupid scripts management tool
19+
Lazyscripts is just a stupid script distrubtion tool and quick-installer
20+
in Linux, which aims to provide a easy way to setup your working environment
21+
for people who need to install a new distrubution such as Debian,Ubuntu,
22+
or who want to have much better experiences in Linux.

data/debian_template/copyright

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
This package was debianized by Hsin Yi Chen (hychen) <[email protected]> on
2+
Sun, 21 Mar 2010 17:38:00 +0800.
3+
4+
It was downloaded from http://www.lazyscripts.org
5+
6+
Upstream Author(s):
7+
Hsin Yi Chen (hychen) <[email protected]>
8+
9+
Copyright:
10+
11+
Copyright (C) 2010 Hsin-Yi Chen (hychen)
12+
13+
License:
14+
15+
This package is free software; you can redistribute it and/or modify
16+
it under the terms of the GNU General Public License as published by
17+
the Free Software Foundation; either version 2 of the License, or
18+
(at your option) any later version.
19+
20+
This package is distributed in the hope that it will be useful,
21+
but WITHOUT ANY WARRANTY; without even the implied warranty of
22+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23+
GNU General Public License for more details.
24+
25+
You should have received a copy of the GNU General Public License
26+
along with this package; if not, write to the Free Software
27+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28+
29+
On Debian systems, the complete text of the GNU General
30+
Public License can be found in `/usr/share/common-licenses/GPL'.
31+
32+
The Debian packaging is (C) 2010, Hsin Yi Chen (hychen) <[email protected]> and
33+
is licensed under the GPL, see above.

data/debian_template/pycompat

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2

data/debian_template/rules

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/make -f
2+
3+
DEB_PYTHON_SYSTEM=pysupport
4+
export DH_PYCENTRAL=include-links
5+
6+
include /usr/share/cdbs/1/rules/debhelper.mk
7+
include /usr/share/cdbs/1/class/python-distutils.mk
8+
include /usr/share/cdbs/1/rules/simple-patchsys.mk

scritps/build_deb.py

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#!/usr/bin/env python
2+
#@FIXME: not perfect way.
3+
import os
4+
import sys
5+
import commands
6+
7+
class BuildDeb(object):
8+
9+
BUILD_DIR = 'bdist'
10+
DEBIAN_DIR = 'data/debian_template'
11+
12+
#{{{def prepare():
13+
def prepare(self):
14+
#Prepare root directory.
15+
os.system("rm -rf %s" % self.BUILD_DIR)
16+
os.system("mkdir -p %s" % self.BUILD_DIR)
17+
18+
#Extract source codes.
19+
pkgname = 'lazyscripts-%s' % tagname
20+
gitcmd = "git archive --prefix=%s/ %s | (cd %s && tar xf -)" % \
21+
(pkgname, tagname, self.BUILD_DIR)
22+
ret = commands.getoutput(gitcmd)
23+
if ret:
24+
print "Extracting sources faild."
25+
exit()
26+
27+
self.TARGET_DIR = os.path.join(self.BUILD_DIR, pkgname)
28+
#Copy debian direcotry into dist source.
29+
cmd = "cp -a %s %s/debian" % (self.DEBIAN_DIR, self.TARGET_DIR)
30+
os.system(cmd)
31+
32+
#Change metadata.
33+
#}}}
34+
35+
#{{{def build():
36+
def build(self):
37+
cmd = "cd %s && debuild -rfakeroot" % self.TARGET_DIR
38+
os.system(cmd)
39+
print """The deb created on %s, this is just for test, you should type
40+
`%s`after the modification""" % (self.BUILD_DIR,cmd)
41+
#}}}
42+
pass
43+
44+
if __name__ == '__main__':
45+
#Example: ./build_deb v0.2rc3
46+
try:
47+
tagname = sys.argv[1]
48+
print "Building deb for reversion:%s" % tagname
49+
except IndexError:
50+
print "Error!"
51+
exit()
52+
53+
o = BuildDeb()
54+
o.prepare()
55+
o.build()

0 commit comments

Comments
 (0)