summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2014-06-23 13:38:46 (EDT)
committer P. J. McDermott <pj@pehjota.net>2014-06-23 13:38:46 (EDT)
commit9e8cbf2627c9ea6edce160388479228eba50928e (patch)
tree3237ad8c96caf10ed849bbf01058631eb0b81742
parentc1e321a81e2171793bc2c75cc50a4ccc66683ef7 (diff)
source.mk: New file.
-rwxr-xr-xbuild1
-rw-r--r--source.mk17
2 files changed, 18 insertions, 0 deletions
diff --git a/build b/build
index 2a40656..2311c06 100755
--- a/build
+++ b/build
@@ -1,5 +1,6 @@
#!/usr/bin/make -f
+upstream_source = glib
include ../source.mk
nop:
diff --git a/source.mk b/source.mk
new file mode 100644
index 0000000..81fe249
--- /dev/null
+++ b/source.mk
@@ -0,0 +1,17 @@
+upstream_base_name = $(upstream_source)-$(OPK_SOURCE_VERSION_UPSTREAM)
+upstream_dir = http://ftp.gnome.org/pub/gnome/sources/$(upstream_source)
+upstream_base_ver = $$(printf '%s\n' '$(OPK_SOURCE_VERSION_UPSTREAM)' | \
+ sed 's/^\([0-9]*\.[0-9]*\)\..*$$/\1/')
+upstream_base_url = $(upstream_dir)/$(upstream_base_ver)/$(upstream_base_name)
+source_archive = ../$(OPK_SOURCE)-$(OPK_SOURCE_VERSION_UPSTREAM).orig.tar.gz
+
+$(source_archive):
+ wget -c "$(upstream_base_url).tar.xz"
+ wget -O - "$(upstream_base_url).sha256sum" | grep -F .tar.xz >sha256sum
+ sha256sum -c sha256sum
+ rm sha256sum
+ unxz -c '$(upstream_base_name).tar.xz' | tar -x
+ tar -czf '$(source_archive)' $(upstream_source)-*/
+ mv $(upstream_source)-*/ src/
+
+source: $(source_archive)