add package: scdoc (#8893)

This commit is contained in:
YAKSH BARIYA 2022-02-04 01:51:37 +00:00 committed by GitHub
parent 296e4ce16e
commit 748beddc9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 81 additions and 0 deletions

View File

@ -0,0 +1,60 @@
--- ./Makefile.orig 2022-02-03 18:20:50.006850878 +0530
+++ ./Makefile 2022-02-03 18:21:34.996850861 +0530
@@ -1,14 +1,14 @@
VERSION=1.11.2
CFLAGS?=-g
MAINFLAGS:=-DVERSION='"$(VERSION)"' -Wall -Wextra -Werror -Wno-unused-parameter
-LDFLAGS+=-static
+LDFLAGS+=
INCLUDE+=-Iinclude
PREFIX?=/usr/local
BINDIR?=$(PREFIX)/bin
MANDIR?=$(PREFIX)/share/man
PCDIR?=$(PREFIX)/share/pkgconfig
-OUTDIR=.build
-HOST_SCDOC=./scdoc
+OUTDIR?=.build
+HOST_SCDOC?=$(OUTDIR)/scdoc
.DEFAULT_GOAL=all
OBJECTS=\
@@ -26,29 +26,29 @@
@mkdir -p $(OUTDIR)
$(CC) -std=c99 -pedantic -c -o $@ $(CFLAGS) $(MAINFLAGS) $(INCLUDE) $<
-scdoc: $(OBJECTS)
+$(OUTDIR)/scdoc: $(OBJECTS)
$(CC) $(LDFLAGS) -o $@ $^
-scdoc.1: scdoc.1.scd $(HOST_SCDOC)
+$(OUTDIR)/scdoc.1: scdoc.1.scd $(HOST_SCDOC)
$(HOST_SCDOC) < $< > $@
-scdoc.5: scdoc.5.scd $(HOST_SCDOC)
+$(OUTDIR)/scdoc.5: scdoc.5.scd $(HOST_SCDOC)
$(HOST_SCDOC) < $< > $@
-scdoc.pc: scdoc.pc.in
+$(OUTDIR)/scdoc.pc: scdoc.pc.in
sed -e 's:@prefix@:$(PREFIX):g' -e 's:@version@:$(VERSION):g' < $< > $@
-all: scdoc scdoc.1 scdoc.5 scdoc.pc
+all: $(OUTDIR)/scdoc $(OUTDIR)/scdoc.1 $(OUTDIR)/scdoc.5 $(OUTDIR)/scdoc.pc
clean:
- rm -rf $(OUTDIR) scdoc scdoc.1 scdoc.5 scdoc.pc
+ rm -rf $(OUTDIR)
install: all
mkdir -p $(DESTDIR)/$(BINDIR) $(DESTDIR)/$(MANDIR)/man1 $(DESTDIR)/$(MANDIR)/man5 $(DESTDIR)/$(PCDIR)
- install -m755 scdoc $(DESTDIR)/$(BINDIR)/scdoc
- install -m644 scdoc.1 $(DESTDIR)/$(MANDIR)/man1/scdoc.1
- install -m644 scdoc.5 $(DESTDIR)/$(MANDIR)/man5/scdoc.5
- install -m644 scdoc.pc $(DESTDIR)/$(PCDIR)/scdoc.pc
+ install -m755 $(OUTDIR)/scdoc $(DESTDIR)/$(BINDIR)/scdoc
+ install -m644 $(OUTDIR)/scdoc.1 $(DESTDIR)/$(MANDIR)/man1/scdoc.1
+ install -m644 $(OUTDIR)/scdoc.5 $(DESTDIR)/$(MANDIR)/man5/scdoc.5
+ install -m644 $(OUTDIR)/scdoc.pc $(DESTDIR)/$(PCDIR)/scdoc.pc
uninstall:
rm -f $(DESTDIR)/$(BINDIR)/scdoc

21
packages/scdoc/build.sh Normal file
View File

@ -0,0 +1,21 @@
TERMUX_PKG_HOMEPAGE=https://git.sr.ht/~sircmpwn/scdoc
TERMUX_PKG_DESCRIPTION="Small man page generator"
TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_MAINTAINER="Yaksh Bariya <yakshbari4@gmail.com>"
TERMUX_PKG_VERSION=1.11.2
TERMUX_PKG_SRCURL=https://git.sr.ht/~sircmpwn/scdoc/archive/$TERMUX_PKG_VERSION.tar.gz
TERMUX_PKG_SHA256=e9ff9981b5854301789a6778ee64ef1f6d1e5f4829a9dd3e58a9a63eacc2e6f0
TERMUX_PKG_BUILD_IN_SRC=true
termux_step_make() {
cd $TERMUX_PKG_SRCDIR
(
unset CC CXX CFLAGS CXXFLAGS LD LDFLAGS
make PREFIX=/usr OUTDIR=$TERMUX_PKG_HOSTBUILD_DIR CC=clang
)
make PREFIX=$TERMUX_PREFIX OUTDIR=$TERMUX_PKG_SRCDIR HOST_SCDOC=$TERMUX_PKG_HOSTBUILD_DIR/scdoc install
}
termux_step_make_install() {
:
}