Bladeren bron

Prepare project

Jakub Jirutka 7 jaren geleden
bovenliggende
commit
d94c39e30e
4 gewijzigde bestanden met toevoegingen van 118 en 0 verwijderingen
  1. 14 0
      .editorconfig
  2. 21 0
      LICENSE
  3. 48 0
      Makefile
  4. 35 0
      README.adoc

+ 14 - 0
.editorconfig

@@ -0,0 +1,14 @@
+; http://editorconfig.org
+root = true
+
+[*]
+charset = utf-8
+end_of_line = lf
+indent_size = 4
+indent_style = tab
+insert_final_newline = true
+trim_trailing_whitespace = true
+
+[*.{adoc,yml}]
+indent_size = 2
+indent_style = space

+ 21 - 0
LICENSE

@@ -0,0 +1,21 @@
+The MIT License
+
+Copyright 2018 Jakub Jirutka <jakub@jirutka.cz>.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.

+ 48 - 0
Makefile

@@ -0,0 +1,48 @@
+SCRIPT_NAME := alpine-make-rootfs
+
+DESTDIR := /
+PREFIX := /usr/local
+
+SED := sed
+SHA1SUM := sha1sum
+
+ifeq ($(shell uname -s),Darwin)
+	SED := gsed
+	SHA1SUM := shasum -a 1
+endif
+
+#: Update version in the script and README.adoc to $VERSION.
+bump-version:
+	test -n "$(VERSION)"  # $$VERSION
+	$(SED) -E -i "s/^(readonly VERSION)=.*/\1='$(VERSION)'/" $(SCRIPT_NAME)
+	$(SED) -E -i "s/^(:version:).*/\1 $(VERSION)/" README.adoc
+
+#: Install the script into $DESTDIR.
+install:
+	mkdir -p $(DESTDIR)$(PREFIX)/bin
+	install -m 755 $(SCRIPT_NAME) $(DESTDIR)$(PREFIX)/bin/$(SCRIPT_NAME)
+
+#: Update variable :script-sha1: in README.adoc with SHA1 checksum of the script.
+readme-update-checksum:
+	$(SED) -E -i \
+		-e "s/^(:script-sha1:).*/\1 $(shell $(SHA1SUM) $(SCRIPT_NAME) | cut -d ' ' -f 1)/" \
+		README.adoc
+
+#: Bump version to $VERSION, create release commit and tag.
+release: .check-git-clean | bump-version readme-update-checksum
+	test -n "$(VERSION)"  # $$VERSION
+	git add .
+	git commit -m "Release version $(VERSION)"
+	git tag -s v$(VERSION) -m v$(VERSION)
+
+#: Print list of targets.
+help:
+	@printf '%s\n\n' 'List of targets:'
+	@$(SED) -En '/^#:.*/{ N; s/^#: (.*)\n([A-Za-z0-9_-]+).*/\2 \1/p }' $(MAKEFILE_LIST) \
+		| while read label desc; do printf '%-30s %s\n' "$$label" "$$desc"; done
+
+.check-git-clean:
+	@test -z "$(shell git status --porcelain)" \
+		|| { echo 'You have uncommitted changes!' >&2; exit 1; }
+
+.PHONY: bump-version install readme-update-checksum release help .check-git-clean

+ 35 - 0
README.adoc

@@ -0,0 +1,35 @@
+= Make Alpine Linux RootFS
+:script-name: alpine-make-rootfs
+:script-sha1: N/A
+:gh-name: jirutka/{script-name}
+:version: 0.0.0
+
+ifdef::env-github[]
+image:https://travis-ci.org/{gh-name}.svg?branch=master["Build Status", link="https://travis-ci.org/{gh-name}"]
+endif::env-github[]
+
+TODO
+
+
+== Requirements
+
+TODO
+
+
+== Usage
+
+Read documentation in link:{script-name}[{script-name}].
+See link:.travis.yml[.travis.yml] for Travis example.
+
+You can copy link:{script-name}[{script-name}] into your repository or download it on demand, e.g.:
+
+[source, sh, subs="+attributes"]
+wget https://raw.githubusercontent.com/{gh-name}/v{version}/{script-name} \
+    && echo '{script-sha1}  {script-name}' | sha1sum -c \
+    || exit 1
+
+
+== License
+
+This project is licensed under http://opensource.org/licenses/MIT/[MIT License].
+For the full text of the license, see the link:LICENSE[LICENSE] file.