-
Notifications
You must be signed in to change notification settings - Fork 874
packagecloud #126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+843
−607
Merged
packagecloud #126
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
ab46e2b
building with fpm, deploying to packagecloud
ab038f9
removed build/deb/libcs50 after building deb
9fe3c6d
all depends on MANS too
9302f26
replaced tabs with spaces
f08b345
updated README
b0ada1f
used postinst and postrm
9d47a77
updated README
f545a2a
uploading github release
d5b5801
added MIT license, installing rpm files in /usr
3cbbec9
moved installation back to /usr/local, added post and postun
20a94bc
building and deploying rpm, used releases provider
d6d5346
fixed deb and rpm maps
0fb44ee
removed package_glob, not using build stages
9d68492
added Fedora instructions
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,107 @@ | ||
dist: trusty | ||
sudo: required | ||
packagecloud: &packagecloud | ||
provider: packagecloud | ||
username: cs50 | ||
repository: libcs50 | ||
token: $PACKAGECLOUD_TOKEN | ||
skip_cleanup: true | ||
on: | ||
branch: master | ||
|
||
deb: &deb | ||
<<: *packagecloud | ||
local-dir: build/deb | ||
|
||
rpm: &rpm | ||
<<: *packagecloud | ||
local-dir: build/rpm | ||
|
||
branches: | ||
except: "/^v\\d/" | ||
env: | ||
matrix: | ||
- DIST=precise DIST_VERSION=12.04 | ||
- DIST=trusty DIST_VERSION=14.04 | ||
- DIST=vivid DIST_VERSION=15.04 | ||
- DIST=xenial DIST_VERSION=16.04 | ||
- DIST=zesty DIST_VERSION=17.04 | ||
before_install: | ||
- sudo apt-get install build-essential debhelper devscripts dh-make lintian | ||
- gem install asciidoctor | ||
install: true | ||
script: if [ "$TRAVIS_BRANCH" != "master" ]; then SIGNING_OPTS="-uc -us" make deb; fi | ||
before_deploy: | ||
- echo -e $GPG_SECRET | gpg --import | ||
addons: | ||
apt: | ||
packages: rpm | ||
before_install: gem install fpm | ||
script: | ||
- make deb | ||
- make rpm | ||
before_deploy: | | ||
if [ -z "$(git tag --list "v$(make version)")" ]; then \ | ||
git config --local user.name "bot50"; \ | ||
git config --local user.email "[email protected]"; \ | ||
git tag "v$(make version)"; \ | ||
fi | ||
deploy: | ||
provider: script | ||
script: dput ppa:cs50/ppa build/deb/*.changes | ||
skip_cleanup: true | ||
on: | ||
branch: master | ||
# Ubuntu | ||
# 12.04 | ||
- <<: *deb | ||
dist: ubuntu/precise | ||
|
||
# 12.10 | ||
- <<: *deb | ||
dist: ubuntu/quantal | ||
|
||
# 13.04 | ||
- <<: *deb | ||
dist: ubuntu/raring | ||
|
||
# 13.10 | ||
- <<: *deb | ||
dist: ubuntu/saucy | ||
|
||
# 14.04 | ||
- <<: *deb | ||
dist: ubuntu/trusty | ||
|
||
# 14.10 | ||
- <<: *deb | ||
dist: ubuntu/utopic | ||
|
||
# 15.04 | ||
- <<: *deb | ||
dist: ubuntu/vivid | ||
|
||
# 15.10 | ||
- <<: *deb | ||
dist: ubuntu/wily | ||
|
||
# 16.04 | ||
- <<: *deb | ||
dist: ubuntu/xenial | ||
|
||
# 16.10 | ||
- <<: *deb | ||
dist: ubuntu/yakkety | ||
|
||
# 17.04 | ||
- <<: *deb | ||
dist: ubuntu/zesty | ||
|
||
# 17.10 | ||
- <<: *deb | ||
dist: ubuntu/artful | ||
|
||
# 18.04 | ||
- <<: *deb | ||
dist: ubuntu/bionic | ||
|
||
# Fedora | ||
- <<: *rpm | ||
dist: fedora/24 | ||
- <<: *rpm | ||
dist: fedora/25 | ||
- <<: *rpm | ||
dist: fedora/26 | ||
- <<: *rpm | ||
dist: fedora/27 | ||
- <<: *rpm | ||
dist: fedora/28 | ||
|
||
# GitHub release | ||
- provider: releases | ||
api_key: $GITHUB_TOKEN | ||
skip_cleanup: true | ||
on: | ||
branch: libcs50 | ||
notifications: | ||
slack: | ||
secure: ISOGlNSGXOrMBrKTnjTWQXVjjoBn78++xF1mUv/PYZxn3J4L4WpybLLjAuBENsD7YeHSaXUnSbIV5mDzlx5Q1cyrS+auGOHqi5xGV01zNBB1Fig1SkUf7zJS8KyjiPKyi+DexnTt1BY4xaA1uGzq9hoGZEPXKHNlz4v1I6f6fHQ= |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Copyright 2012-2018 CS50 | ||
|
||
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,12 +7,12 @@ MANDIR ?= share/man/man3 | |
|
||
SRC := src/cs50.c | ||
INCLUDE := src/cs50.h | ||
DOCS := $(wildcard docs/*.adoc) | ||
MANS := $(addprefix debian/, $(DOCS:%.adoc=%.3)) | ||
MANS := $(wildcard docs/*.3) | ||
|
||
CFLAGS=-Wall -Wextra -Werror -pedantic -std=c99 | ||
|
||
OS := $(shell uname) | ||
|
||
# Linux | ||
ifeq ($(OS),Linux) | ||
LIB_BASE := libcs50.so | ||
|
@@ -36,50 +36,90 @@ $(LIBS): $(SRC) $(INCLUDE) Makefile | |
$(CC) $(CFLAGS) -fPIC -shared $(LINKER_FLAGS) -o $(LIB_VERSION) $(SRC) | ||
ln -s $(LIB_VERSION) $(LIB_MAJOR) | ||
ln -s $(LIB_MAJOR) $(LIB_BASE) | ||
mkdir -p src build/include | ||
install -m 644 src/cs50.h build/include/cs50.h | ||
mkdir -p build/lib build/src/libcs50 | ||
mkdir -p $(addprefix build/, include lib src) | ||
install -m 644 $(SRC) build/src | ||
install -m 644 $(INCLUDE) build/include | ||
mv $(LIB_VERSION) $(LIB_MAJOR) $(LIB_BASE) build/lib | ||
cp -r $(SRC) $(INCLUDE) build/src/libcs50 | ||
|
||
.PHONY: install | ||
install: all | ||
mkdir -p $(addprefix $(DESTDIR)/, src lib include $(MANDIR)) | ||
cp -r build/* $(DESTDIR) | ||
cp debian/docs/* $(DESTDIR)/$(MANDIR) | ||
cp -r $(filter-out deb, $(wildcard build/*)) $(DESTDIR) | ||
cp -r $(MANS) $(DESTDIR)/$(MANDIR) | ||
|
||
ifeq ($(OS),Linux) | ||
ldconfig | ||
endif | ||
|
||
.PHONY: clean | ||
clean: | ||
rm -rf build debian/docs/ | ||
|
||
# requires asciidoctor (gem install asciidoctor) | ||
$(MANS): $(DOCS) Makefile | ||
asciidoctor -d manpage -b manpage -D debian/docs/ $(DOCS) | ||
rm -rf build | ||
|
||
.PHONY: deb | ||
deb: $(LIBS) $(MANS) | ||
rm -rf build/deb &>/dev/null | ||
@echo "libcs50 ($(VERSION)-0ubuntu$(DIST_VERSION)) $(DIST); urgency=low" > debian/changelog | ||
@echo " * v$(VERSION)" >> debian/changelog | ||
@echo " -- CS50 Sysadmins <[email protected]> $$(date --rfc-2822)" >> debian/changelog | ||
mkdir -p libcs50-$(VERSION)/usr | ||
cp -r build/* libcs50-$(VERSION)/usr | ||
GZIP=-n tar --mtime='2017-01-01' -cvzf libcs50_$(VERSION).orig.tar.gz libcs50-$(VERSION) | ||
cp -r debian libcs50-$(VERSION) | ||
cd libcs50-$(VERSION) && debuild $(SIGNING_OPTS) -S -sa --lintian-opts --display-info --info --show-overrides | ||
mkdir -p build/deb | ||
mv libcs50-* libcs50_* build/deb | ||
|
||
.PHONY: hack | ||
hack: | ||
mkdir -p build/hack | ||
echo "\n#ifndef _CS50_C\n#define _CS50_C\ntypedef char *string;\n" > build/hack/cs50.h | ||
grep -v '^#include "cs50.h"' src/cs50.c >> build/hack/cs50.h | ||
echo "\n#endif" >> build/hack/cs50.h | ||
cat src/cs50.h >> build/hack/cs50.h | ||
rm -rf build/deb | ||
|
||
# temporary fpm source | ||
mkdir -p build/deb/libcs50/usr/local | ||
cp -r $(addprefix build/, include lib src) build/deb/libcs50/usr/local | ||
mkdir -p build/deb/libcs50/usr/local/share/man/man3 | ||
cp -r $(MANS) build/deb/libcs50/usr/local/share/man/man3 | ||
fpm \ | ||
--after-install postinst \ | ||
--after-remove postrm \ | ||
--category libs \ | ||
--chdir build/deb/libcs50 \ | ||
--conflicts lib50-c \ | ||
--conflicts libcs50 \ | ||
--conflicts library50-c \ | ||
--deb-priority optional \ | ||
--description "CS50 library for C" \ | ||
--input-type dir \ | ||
--license "MIT" \ | ||
--maintainer "CS50 <[email protected]>" \ | ||
--name libcs50 \ | ||
--output-type deb \ | ||
--package build/deb \ | ||
--provides lib50-c \ | ||
--provides libcs50 \ | ||
--provides library50-c \ | ||
--replaces lib50-c \ | ||
--replaces libcs50 \ | ||
--replaces library50-c \ | ||
--url https://github.com/cs50/libcs50 \ | ||
--vendor CS50 \ | ||
--version $(VERSION) \ | ||
. | ||
|
||
rm -rf build/deb/libcs50 | ||
|
||
rpm: $(LIBS) $(MANS) | ||
rm -rf build/rpm | ||
|
||
# temporary fpm source | ||
mkdir -p build/rpm/libcs50/usr/local | ||
cp -r $(addprefix build/, include lib src) build/rpm/libcs50/usr/local | ||
mkdir -p build/rpm/libcs50/usr/local/share/man/man3 | ||
cp -r $(MANS) build/rpm/libcs50/usr/local/share/man/man3 | ||
fpm \ | ||
--after-install post \ | ||
--after-remove postun \ | ||
--category libs \ | ||
--chdir build/rpm/libcs50 \ | ||
--description "CS50 library for C" \ | ||
--input-type dir \ | ||
--license "MIT" \ | ||
--maintainer "CS50 <[email protected]>" \ | ||
--name libcs50 \ | ||
--output-type rpm \ | ||
--package build/rpm \ | ||
--provides libcs50 \ | ||
--url https://github.com/cs50/libcs50 \ | ||
--vendor CS50 \ | ||
--version $(VERSION) \ | ||
. | ||
|
||
rm -rf build/rpm/libcs50 | ||
|
||
# used by .travis.yml | ||
.PHONY: version | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What’s the & do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This defines a variable of some sort in YAML, allowing us to substitute them later using the
<<: *packagecloud
syntax to avoid repeating all these key/value pairs.http://yaml.org/type/merge.html