Skip to content

Commit

Permalink
Add cowsay (#275)
Browse files Browse the repository at this point in the history
  • Loading branch information
CRKatri authored Dec 29, 2020
1 parent 37b88ee commit 70c3803
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 0 deletions.
16 changes: 16 additions & 0 deletions build_info/cowsay-off.control
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Package: cowsay-off
Version: @DEB_COWSAY_V@
Architecture: @DEB_ARCH@
Maintainer: @DEB_MAINTAINER@
Depends: perl, cowsay (= @DEB_COWSAY_V@)
Section: Games
Priority: optional
Description: configurable talking cow (offensive cows)
Cowsay (or cowthink) will turn text into happy ASCII cows, with
speech (or thought) balloons. If you don't like cows, ASCII art is
available to replace it with some other creatures (Tux, the BSD
daemon, dragons, and a plethora of animals, from a turkey to
an elephant in a snake).
.
This package contains cows which some may consider to be offensive.
Please do not install this package if you or your users are easily offended.
13 changes: 13 additions & 0 deletions build_info/cowsay.control
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Package: cowsay
Version: @DEB_COWSAY_V@
Architecture: @DEB_ARCH@
Maintainer: @DEB_MAINTAINER@
Depends: perl
Section: Games
Priority: optional
Description: configurable talking cow
Cowsay (or cowthink) will turn text into happy ASCII cows, with
speech (or thought) balloons. If you don't like cows, ASCII art is
available to replace it with some other creatures (Tux, the BSD
daemon, dragons, and a plethora of animals, from a turkey to
an elephant in a snake).
48 changes: 48 additions & 0 deletions cowsay.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
ifneq ($(PROCURSUS),1)
$(error Use the main Makefile)
endif

SUBPROJECTS += cowsay
COWSAY_VERSION := 3.04
DEB_COWSAY_V ?= $(COWSAY_VERSION)

cowsay-setup: setup
wget -q -nc -P $(BUILD_SOURCE) https://github.com/tnalpgge/rank-amateur-cowsay/archive/cowsay-$(COWSAY_VERSION).tar.gz
$(call EXTRACT_TAR,cowsay-$(COWSAY_VERSION).tar.gz,rank-amateur-cowsay-cowsay-$(COWSAY_VERSION),cowsay)
mkdir -p $(BUILD_STAGE)/cowsay/usr/{games,share/man/man1}

ifneq ($(wildcard $(BUILD_WORK)/cowsay/.build_complete),)
cowsay:
@echo "Using previously built cowsay."
else
cowsay: cowsay-setup
$(SED) -i -e 's|%BANGPERL%|!/usr/bin/perl|' -e 's|%PREFIX%|/usr|' $(BUILD_WORK)/cowsay/cowsay $(BUILD_WORK)/cowsay/cowsay.1
cp -a $(BUILD_WORK)/cowsay/cowsay $(BUILD_STAGE)/cowsay/usr/games
cp -a $(BUILD_WORK)/cowsay/cowsay.1 $(BUILD_STAGE)/cowsay/usr/share/man/man1
cp -a $(BUILD_WORK)/cowsay/cows $(BUILD_STAGE)/cowsay/usr/share
ln -s cowsay $(BUILD_STAGE)/cowsay/usr/games/cowthink
ln -s cowsay.1.zst $(BUILD_STAGE)/cowsay/usr/share/man/man1/cowthink.1
touch $(BUILD_WORK)/cowsay/.build_complete
endif

cowsay-package: cowsay-stage
# cowsay.mk Package Structure
rm -rf $(BUILD_DIST)/cowsay{,-off}
mkdir -p $(BUILD_DIST)/cowsay{,-off}/usr/share/cows

# cowsay.mk Prep cowsay
cp -a $(BUILD_STAGE)/cowsay/usr/games $(BUILD_DIST)/cowsay/usr
cp -a $(BUILD_STAGE)/cowsay/usr/share/man $(BUILD_DIST)/cowsay/usr/share
cp -a $(BUILD_STAGE)/cowsay/usr/share/cows/!(beavis.zen.cow|bong.cow|mutilated.cow|head-in.cow) $(BUILD_DIST)/cowsay/usr/share/cows

# cowsay.mk Prep cowsay-off
cp -a $(BUILD_STAGE)/cowsay/usr/share/cows/{beavis.zen.cow,bong.cow,mutilated.cow,head-in.cow} $(BUILD_DIST)/cowsay-off/usr/share/cows

# cowsay.mk Make .debs
$(call PACK,cowsay,DEB_COWSAY_V)
$(call PACK,cowsay-off,DEB_COWSAY_V)

# cowsay.mk Build cleanup
rm -rf $(BUILD_DIST)/cowsay{,-off}

.PHONY: cowsay cowsay-package

0 comments on commit 70c3803

Please sign in to comment.