Skip to content

Commit

Permalink
Install pkg-config file
Browse files Browse the repository at this point in the history
Closes: #12
  • Loading branch information
illiliti committed Jul 23, 2022
1 parent a934c61 commit 0dcabcc
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
18 changes: 16 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,27 @@ Makefile.inc: configure
@echo "$@ generated. Run the make again."
@exit 1

install: Makefile.inc
hwdata.pc: hwdata.pc.in
datadir="$(datadir)"; \
if [ "$${datadir#$(prefix)}" != "$$datadir" ]; then \
datadir="\$${prefix}$${datadir#$(prefix)}"; \
fi; \
sed -e 's|@prefix@|$(prefix)|g' \
-e "s|@datadir@|$$datadir|g" \
-e 's|@pkgdatadir@|$${datadir}/$(NAME)|g' \
-e 's|@VERSION@|$(VERSION)|g' \
-e 's|@NAME@|$(NAME)|g' \
$< > $@

install: Makefile.inc hwdata.pc
mkdir -p -m 755 $(DESTDIR)$(datadir)/$(NAME)
for foo in $(IDFILES) ; do \
install -m 644 $$foo $(DESTDIR)$(datadir)/$(NAME) ;\
done
mkdir -p -m 755 $(DESTDIR)$(libdir)/modprobe.d
install -m 644 -T blacklist.conf $(DESTDIR)$(libdir)/modprobe.d/dist-blacklist.conf
mkdir -p -m 755 $(DESTDIR)$(datadir)/pkgconfig
install -m 644 hwdata.pc $(DESTDIR)$(datadir)/pkgconfig/

commit:
git commit -vas ||:
Expand Down Expand Up @@ -89,7 +103,7 @@ srpm-x: create-archive

clean:
@rm -f $(NAME)-*.gz $(NAME)-*.src.rpm pnp.ids.xlsx \
*.downloaded *.utf8 *.orig
*.downloaded *.utf8 *.orig hwdata.pc

clog: hwdata.spec
@sed -n '/^%changelog/,/^$$/{/^%/d;/^$$/d;s/%%/%/g;p}' $< | tee $@
Expand Down
8 changes: 8 additions & 0 deletions hwdata.pc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
prefix=@prefix@
datadir=@datadir@
pkgdatadir=@pkgdatadir@

Name: @NAME@
Description: Hardware identification and configuration data
Version: @VERSION@
URL: https://github.com/vcrhonek/hwdata
1 change: 1 addition & 0 deletions hwdata.spec
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ such as the pci.ids and usb.ids databases.
%dir %{_datadir}/%{name}
%{_prefix}/lib/modprobe.d/dist-blacklist.conf
%{_datadir}/%{name}/*
%{_datadir}/pkgconfig/%{name}.pc

%changelog
* Mon Jul 04 2022 Vitezslav Crhonek <vcrhonek@redhat.com> - 0.361-1
Expand Down

0 comments on commit 0dcabcc

Please sign in to comment.