Skip to content

Commit acccd41

Browse files
besser82solardiz
authored andcommitted
misc: Add pkgconfig file.
pkg-config files provide a useful mechanism for storing various information about libraries and packages on a given system. Information stored by .pc files include compiler and linker flags necessary to use a given library, as well as any other relevant metadata. Signed-off-by: Björn Esser <[email protected]>
1 parent 70d37e2 commit acccd41

File tree

6 files changed

+47
-8
lines changed

6 files changed

+47
-8
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
/libs/libtcb.so
66
/libs/libtcb.so.0
77
/libs/libtcb.so.0.*
8+
/misc/tcb.pc
89
/misc/tcb.sysusers
910
/pam_tcb/pam_tcb.so*
1011
/progs/tcb_chkpwd

ChangeLog

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,21 @@
2929
* misc/tcb-auth.sysusers: New file.
3030
* .gitignore: Add build output from "misc" directory.
3131

32+
misc: Add pkgconfig file.
33+
pkgconfig files provide a useful mechanism for storing various
34+
information about libraries and packages on a given system.
35+
Information stored by .pc files include compiler and linker flags
36+
necessary to use a given library, as well as any other relevant
37+
metadata.
38+
* Make.defs: Add new presets for PREFIX, INCLUDEDIR, and
39+
PKGCONFIGDIR. Also adapt the existing presets slightly.
40+
* misc/Makefile: Build and install the pkgconfig file.
41+
Also use INCLUDEDIR instead of hardcoding its path, and
42+
adapt the clean target.
43+
* misc/tcb.pc.in: New file.
44+
* tcb.spec: Add pkgconfig file.
45+
* .gitignore: Add ignore rule for tcb.pc.
46+
3247
2021-09-25 Björn Esser <besser82 at fedoraproject.org>
3348

3449
* pam_tcb/support.c (_set_ctrl): Request automatic prefix only if

Make.defs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,14 @@ endif
1717
#CFLAGS += -DFAIL_RECORD
1818
LDFLAGS += $(DBGFLAG) -L../libs
1919

20+
PREFIX = /usr
2021
SBINDIR = /sbin
2122
SLIBDIR = /lib
22-
LIBDIR = /usr/lib
23-
LIBEXECDIR = /usr/libexec
24-
MANDIR = /usr/man
25-
SYSUSERSDIR = /usr/lib/sysusers.d
23+
INCLUDEDIR = $(PREFIX)/include
24+
LIBDIR = $(PREFIX)/lib
25+
LIBEXECDIR = $(PREFIX)/libexec
26+
MANDIR = $(PREFIX)/man
27+
PKGCONFIGDIR = $(LIBDIR)/pkgconfig
28+
SYSUSERSDIR = $(PREFIX)/lib/sysusers.d
2629

2730
SHLIBMODE = 755

misc/Makefile

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
include ../Make.defs
22

3-
all: tcb.sysusers
3+
VERSION != sed -e "/^Version: */!d;s///;q" < ../tcb.spec
4+
5+
all: tcb.pc tcb.sysusers
6+
7+
tcb.pc: tcb.pc.in
8+
sed -e "s!@PREFIX@!$(PREFIX)!g" -e "s!@SLIBDIR@!$(SLIBDIR)!g" \
9+
-e "s!@INCLUDEDIR@!$(INCLUDEDIR)!g" -e "s!@VERSION@!$(VERSION)!g" \
10+
< $< > $@
411

512
tcb.sysusers: tcb.sysusers.in
613
sed -e "s!@LIBEXECDIR@!$(LIBEXECDIR)!g" < $< > $@
@@ -9,10 +16,12 @@ install-non-root: install
916

1017
install:
1118
$(MKDIR) -p -m 755 $(DESTDIR)$(MANDIR)/man5
12-
$(MKDIR) -p -m 755 $(DESTDIR)/usr/include
19+
$(MKDIR) -p -m 755 $(DESTDIR)$(INCLUDEDIR)
20+
$(MKDIR) -p -m 755 $(DESTDIR)$(PKGCONFIGDIR)
1321

1422
$(INSTALL) -m 644 tcb.5 $(DESTDIR)$(MANDIR)/man5/
15-
$(INSTALL) -m 644 ../include/tcb.h $(DESTDIR)/usr/include/
23+
$(INSTALL) -m 644 ../include/tcb.h $(DESTDIR)$(INCLUDEDIR)
24+
$(INSTALL) -m 644 tcb.pc $(DESTDIR)$(PKGCONFIGDIR)
1625

1726
install-sysusers:
1827
$(MKDIR) -p -m 755 $(DESTDIR)$(SYSUSERSDIR)
@@ -22,4 +31,4 @@ install-sysusers-auth: install-sysusers
2231
$(INSTALL) -m 644 tcb-auth.sysusers $(DESTDIR)$(SYSUSERSDIR)/tcb-auth.conf
2332

2433
clean:
25-
rm -f tcb.sysusers
34+
rm -f tcb.pc tcb.sysusers

misc/tcb.pc.in

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
prefix=@PREFIX@
2+
exec_prefix=${prefix}
3+
libdir=@SLIBDIR@
4+
includedir=@INCLUDEDIR@
5+
6+
Name: tcb
7+
Description: Library implementing the tcb password shadowing scheme
8+
Version: @VERSION@
9+
Libs: -L${libdir} -ltcb
10+
Cflags: -I${includedir}

tcb.spec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ rmdir /sbin/chkpwd.d
8787
%_includedir/tcb.h
8888
%_libdir/libtcb.a
8989
%_libdir/libtcb.so
90+
%_libdir/pkgconfig/tcb.pc
9091

9192
%changelog
9293
* Mon Jan 11 2021 Solar Designer <solar-at-owl.openwall.com> 1.2-owl1

0 commit comments

Comments
 (0)