From 0d0a8948677cb29e2d99dc353f9ff71014fa9bac Mon Sep 17 00:00:00 2001 From: Igor Pashev Date: Thu, 11 Oct 2012 18:31:55 +0400 Subject: Added Git support --- README.md | 14 +++++++++++++ examples/symlinks/Makefile | 30 ++++++++++++++++++++++++++++ examples/symlinks/symlinks.license | 21 ++++++++++++++++++++ examples/symlinks/symlinks.p5m | 10 ++++++++++ rules/git.mk | 40 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 115 insertions(+) create mode 100644 examples/symlinks/Makefile create mode 100644 examples/symlinks/symlinks.license create mode 100644 examples/symlinks/symlinks.p5m create mode 100644 rules/git.mk diff --git a/README.md b/README.md index c917e79..c03decd 100644 --- a/README.md +++ b/README.md @@ -75,3 +75,17 @@ are in "work/manifests" directory. Any variable defined in Makefile will be passed to `pkgmogrify` and can be used in IPS manifests (*.p5m). + +## git.mk + +Use this modules to get sources from Git repositories. With this module included +targets `download` and `unpack` mean the same thing - clone git reporitory into +source directory ("work/source"), then checkout given tag, commit or branch. + +Makefile should define two variables: + +* `git-url` - URL of Git repository, used as `git clone $(git-url) $(sourcedir)` +* `git-checkout` - Git tag, branch or commit; used as `git checkout $(git-checkout)` + +For example see "examples/symlinks". + diff --git a/examples/symlinks/Makefile b/examples/symlinks/Makefile new file mode 100644 index 0000000..8387e76 --- /dev/null +++ b/examples/symlinks/Makefile @@ -0,0 +1,30 @@ +include /usr/share/cibs/rules/ips.mk +include /usr/share/cibs/rules/git.mk +include /usr/share/cibs/rules/32.mk + + +summary := scan/change symbolic links +license := PD-like +license-file := symlinks.license + +home := http://packages.debian.org/source/sid/symlinks +name := symlinks +version := 1.4 +git-url := http://anonscm.debian.org/git/users/joachim-guest/symlinks.git + +# Tag, commit or branch. Passed to git checkout as is: +# git checkout $(git-checkout) +git-checkout := upstream/$(version) + +configure-%-stamp: + touch $@ + +build-%-stamp: download-stamp + [ -d "$(builddir)" ] || mkdir -p "$(builddir)" + $(CC) $(CFLAGS) $(sourcedir)/symlinks.c -o $(builddir)/symlinks + touch $@ + +install-%-stamp: build-%-stamp + mkdir -p $(destdir)/$(bindir) + cp $(builddir)/symlinks $(destdir)/$(bindir) + touch $@ diff --git a/examples/symlinks/symlinks.license b/examples/symlinks/symlinks.license new file mode 100644 index 0000000..3d6574c --- /dev/null +++ b/examples/symlinks/symlinks.license @@ -0,0 +1,21 @@ +Copyright (C) 2009 Mark Lord, freely distributable + +Hi, + +My "symlinks" utility pre-dates the "open source licensing" fad +by a number of years. Just to clarify, this is 100% freeware, +written entirely by myself. The intent is to use it to detect +missing/obsolete symlink targets on an installed distro, before +creating the "gold" (or "final") release discs. + +Use and distribute and modify as you (or anyone else) sees fit. +There have no formal restrictions or requirements whatsoever +regarding distribution of either binaries or source code, +whether modified or original. + +Cheers +-- +Mark Lord +Real-Time Remedies Inc. +mlord@pobox.com + diff --git a/examples/symlinks/symlinks.p5m b/examples/symlinks/symlinks.p5m new file mode 100644 index 0000000..c0097a3 --- /dev/null +++ b/examples/symlinks/symlinks.p5m @@ -0,0 +1,10 @@ +set name=pkg.fmri value=pkg:/file/$(name)@$(ips-version) +set name=pkg.summary value="$(summary)" +set name=info.upstream-url value="$(home)" +set name=info.source-url value="$(git-url)" + +license $(license-file) license=$(license) + +file path=usr/bin/symlinks +file symlinks.8 path=usr/share/man/man8/symlinks.8 + diff --git a/rules/git.mk b/rules/git.mk new file mode 100644 index 0000000..b631f1a --- /dev/null +++ b/rules/git.mk @@ -0,0 +1,40 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license +# at http://www.opensource.org/licenses/CDDL-1.0 +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each file. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# +# +# Copyright (C) 2012, Nexenta Systems, Inc. All rights reserved. +# + +# include guard +ifeq (,$(__git_mk)) + +build-depends += developer/versioning/git + +download-stamp: check-build-dep-stamp +unpack-stamp: download-stamp + +download-stamp: + git clone $(git-url) $(sourcedir) + cd $(sourcedir) && git checkout $(git-checkout) + touch $@ +download: download-stamp + +__git_mk := included +endif + -- cgit v1.2.3