build: Generate the PKGBUILD file during `scons release`
This is better than needing to update it manually... Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
This commit is contained in:
parent
faadd138c4
commit
f64bf65b37
|
@ -7,3 +7,5 @@ ocarina.bin
|
||||||
bin/
|
bin/
|
||||||
lib/
|
lib/
|
||||||
include/version.h
|
include/version.h
|
||||||
|
PKGBUILD
|
||||||
|
!PKGBUILD.tmpl
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# Maintainer: Bryan Schumaker <bjschuma@gmail.com>
|
# Maintainer: Bryan Schumaker <bjschuma@gmail.com>
|
||||||
pkgname=ocarina
|
pkgname=ocarina
|
||||||
pkgver=5.8
|
pkgver=
|
||||||
pkgrel=1
|
pkgrel=1
|
||||||
pkgdesc="A simple GTK and gstreamer based music player."
|
pkgdesc="A simple GTK and gstreamer based music player."
|
||||||
url="http://www.ocarinaproject.net/"
|
url="http://www.ocarinaproject.net/"
|
||||||
|
@ -12,8 +12,8 @@ makedepends=('scons')
|
||||||
conflicts=()
|
conflicts=()
|
||||||
replaces=()
|
replaces=()
|
||||||
backup=()
|
backup=()
|
||||||
source=("http://ocarinaproject.net/wp-content/uploads/2012/05/${pkgname}-${pkgver}.tar.gz")
|
source=("http://ocarinaproject.net/wp-content/uploads/YEAR/MONTH/${pkgname}-${pkgver}.tar.gz")
|
||||||
md5sums=('b2aecf434035823fa1d3c759d2ff4b41')
|
md5sums=
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
cd "${srcdir}/${pkgname}-${pkgver}"
|
cd "${srcdir}/${pkgname}-${pkgver}"
|
24
Sconstruct
24
Sconstruct
|
@ -71,9 +71,25 @@ env.Command("uninstall", None, Delete(FindInstalledFiles()))
|
||||||
# Clean up the build directory
|
# Clean up the build directory
|
||||||
clean = Clean(ocarina, ["include/version.h", "bin/", "lib/"])
|
clean = Clean(ocarina, ["include/version.h", "bin/", "lib/"])
|
||||||
|
|
||||||
# Create a tarball
|
# Create a tarball and a PKGBUILD script
|
||||||
def git_archive(target, source, env):
|
def prepare_release(target, source, env):
|
||||||
|
import datetime
|
||||||
|
|
||||||
ocarina="ocarina-%s" % config.version
|
ocarina="ocarina-%s" % config.version
|
||||||
os.popen("git archive --prefix=%s/ -o %s.tar.gz HEAD" % (ocarina, ocarina))
|
os.popen("git archive --prefix=%s/ -o %s.tar.gz HEAD" % (ocarina, ocarina))
|
||||||
print "md5sum:", os.popen("md5sum %s.tar.gz" % ocarina).read()
|
md5 = os.popen("md5sum %s.tar.gz | awk '{print $1}'" % ocarina).read().strip()
|
||||||
env.Command("archive", None, [git_archive])
|
|
||||||
|
now = datetime.datetime.now()
|
||||||
|
year = str(now.year)
|
||||||
|
month = str(now.month)
|
||||||
|
|
||||||
|
f = open("PKGBUILD", "w")
|
||||||
|
for line in open("PKGBUILD.tmpl"):
|
||||||
|
line = line.replace("pkgver=", "pkgver=%s.%s" % (config.MAJOR, config.MINOR))
|
||||||
|
line = line.replace("md5sums=", "md5sums=('%s')" % md5)
|
||||||
|
line = line.replace("YEAR", year)
|
||||||
|
line = line.replace("MONTH", month)
|
||||||
|
f.write(line)
|
||||||
|
f.close()
|
||||||
|
|
||||||
|
env.Command("release", None, [prepare_release])
|
||||||
|
|
Loading…
Reference in New Issue