Added some packaging stuff
This commit is contained in:
parent
2903f33540
commit
cbb4a0c2b1
37
Makefile
37
Makefile
|
@ -36,11 +36,18 @@ uninstall: uninstall-lib uninstall-doc uninstall-cfgtool
|
|||
# Reinstall everything. (EXPERIMENTAL)
|
||||
reinstall: uninstall install
|
||||
|
||||
# Make a distribution tarball.
|
||||
# Make a distribution tarball
|
||||
dist: mrproper
|
||||
$(call bcmd,mkdir,lib$(NAME)-$(VERSION),\
|
||||
$(MD) .dist)
|
||||
$(call bcmd,cp,* lib$(NAME)-$(VERSION),\
|
||||
$(CP) -R * .dist)
|
||||
$(call qcmd,\
|
||||
$(MV) .dist lib$(NAME)-$(VERSION))
|
||||
$(call bcmd,tarball,lib$(NAME)-$(VERSION),\
|
||||
tar czf lib$(NAME)-$(VERSION).tar.gz \
|
||||
--exclude .git --transform "s/^/lib$(NAME)-$(VERSION)\//" *)
|
||||
--exclude .git lib$(NAME)-$(VERSION))
|
||||
$(call qcmd,$(RM) -r lib$(NAME)-$(VERSION))
|
||||
|
||||
.PHONY: all mostlyclean mclean clean fclean mrproper re
|
||||
.PHONY: dist install uninstall reinstall
|
||||
|
@ -122,19 +129,17 @@ $(eval $(call make-moduleobj-rule,$(mod))))
|
|||
$(call imsg,Installing the library.)
|
||||
$(call qcmd,$(INST) -m 755 -d "$(ILIBDIR)")
|
||||
$(call qcmd,$(INST) -m 755 -t "$(ILIBDIR)" $(SONAME))
|
||||
|
||||
$(if $(LINK_TO_MAJOR),\
|
||||
$(call imsg,Linking lib$(NAME).so to lib$(NAME).so.$(MAJOR).))
|
||||
$(if $(LINK_TO_MAJOR),\
|
||||
$(call qcmd,$(LN) lib$(NAME).so.$(MAJOR) "$(ILIBDIR)/lib$(NAME).so"))
|
||||
|
||||
$(if $(INSTALL_DEVEL),\
|
||||
$(call imsg,Installing development files.))
|
||||
$(if $(INSTALL_DEVEL),\
|
||||
$(call qcmd,$(INST) -m 755 -d $(patsubst %,"$(IINCDIR)/%",\
|
||||
$(sort $(dir $(INCPUB))))))
|
||||
$(if $(INSTALL_DEVEL),$(call qcmd,$(INST) -m 755 -d $(patsubst %,\
|
||||
"$(IINCDIR)/lib$(NAME)-$(VERSION)/%",$(sort $(dir $(INCPUB))))))
|
||||
$(if $(INSTALL_DEVEL),$(foreach i,$(INCPUB),\
|
||||
$(call qcmd,$(INST) -m 644 $(INCDIR)/$(i).h "$(IINCDIR)/$(i).h"$(\n))))
|
||||
$(call qcmd,$(INST) -m 644 $(INCDIR)/$(i).h \
|
||||
"$(IINCDIR)/lib$(NAME)-$(VERSION)/$(i).h"$(\n))))
|
||||
|
||||
# Uninstall the library, development files and udev rule. (experimental)
|
||||
uninstall-lib: $(CHECKCFG)
|
||||
|
@ -156,16 +161,15 @@ $(eval $(call make-moduleobj-rule,$(mod))))
|
|||
$(call qcmd,tools/write-config \
|
||||
--name=lib$(NAME) --version=$(VERSION) \
|
||||
--maintainer="$(MAINTAINER_NAME) <$(MAINTAINER_MAIL)>" \
|
||||
--incdir="$(OIINCDIR)" --libdir="$(OILIBDIR)" \
|
||||
--incdir="$(OIINCDIR)/lib$(NAME)-$(VERSION)" --libdir="$(OILIBDIR)" \
|
||||
>"$(IBINDIR)/lib$(NAME)-config" \
|
||||
&& chmod 755 "$(IBINDIR)/lib$(NAME)-config")
|
||||
|
||||
$(call imsg,Installing the pkg-config configuration.)
|
||||
$(call qcmd,$(INST) -m 755 -d "$(IPKGDIR)")
|
||||
$(call qcmd,tools/write-pkg-config \
|
||||
--name=$(NAME) --version=$(VERSION) \
|
||||
--description="$(DESCRIPTION)" \
|
||||
--incdir="$(OIINCDIR)" --libdir="$(OILIBDIR)" \
|
||||
--incdir="$(OIINCDIR)/lib$(NAME)-$(VERSION)" --libdir="$(OILIBDIR)" \
|
||||
>"$(IPKGDIR)/lib$(NAME).pc" \
|
||||
&& chmod 644 "$(IPKGDIR)/lib$(NAME).pc")
|
||||
|
||||
|
@ -239,4 +243,15 @@ $(eval $(call make-uninstall-doc-rule,$(sec))))
|
|||
.PHONY: all-doc mostlyclean-doc mclean-doc clean-doc re-doc
|
||||
.PHONY: install-doc uninstall-doc
|
||||
.PHONY: $(foreach s,$(MAN_SECTIONS),install-doc-$(s) uninstall-doc-$(s))
|
||||
#******************************************************************************#
|
||||
# Packaging #
|
||||
#******************************************************************************#
|
||||
# Package for debian.
|
||||
deb:
|
||||
debuild --no-tgz-check -us -uc
|
||||
# Clean packaging
|
||||
clean-deb:
|
||||
debuild clean
|
||||
|
||||
.PHONY: deb clean-deb
|
||||
# End of file.
|
||||
|
|
|
@ -68,7 +68,7 @@
|
|||
# - All C compiling flags
|
||||
CFLAGS := -I $(INCDIR) $(CHKFLAGS) -std=gnu11 -fPIC -O2 \
|
||||
-D LOGLEVEL="ll_$(LOG_LEVEL)" \
|
||||
-D AUTHOR="$(AUTHOR)" -D AUTHOR_MAIL="$(AUTHOR_MAIL)" \
|
||||
-D MAINTAINER="$(MAINTAINER_NAME) <$(MAINTAINER_MAIL)>" \
|
||||
-D LICENSE="$(LICENSE)" -D VERSION="$(VERSION)" \
|
||||
$(shell $(PKGCONFIG) --cflags zlib 2>/dev/null ) \
|
||||
$(CMOREFLAGS)
|
||||
|
|
12
README.md
12
README.md
|
@ -28,8 +28,18 @@ I took these as a reference because these are the ones I work with.
|
|||
| -------------------------------------------------- | -------- |
|
||||
| [zlib](http://zlib.net/) | >= 1.2.8 |
|
||||
|
||||
### Debian Packaging dependencies
|
||||
| Name | Version |
|
||||
| ----------------------------------------------------------- | -------- |
|
||||
| [debhelper](http://joeyh.name/code/debhelper/) | >= 9.0 |
|
||||
| [devscripts](https://packages.debian.org/stable/devscripts) | >= 2.15 |
|
||||
|
||||
## Building
|
||||
Just `./configure` then `make`.
|
||||
To package for Debian, use the `deb` target. You shouldn't configure before
|
||||
running this target, `debian/rules` will make it for you. Packages and
|
||||
associated file are created in the parent directory.
|
||||
|
||||
If you ought to make it yourself, just `./configure` then `make`.
|
||||
To install, use `make install`.
|
||||
|
||||
If you're using a custom target, by default, the prefix will be
|
||||
|
|
|
@ -135,16 +135,14 @@ got '$level'"
|
|||
esac; done
|
||||
|
||||
#******************************************************************************#
|
||||
# Check for defaults #
|
||||
# Little things #
|
||||
#******************************************************************************#
|
||||
# Cross-compiling things
|
||||
if [ ! $prefix_set ]; then
|
||||
prefix='${root}/usr/'"$target"
|
||||
# Cross-compilation things
|
||||
if [ ! $prefix_set ] && [ $target ]; then
|
||||
prefix="$prefix"/"$target"
|
||||
fi
|
||||
|
||||
#******************************************************************************#
|
||||
# Evaluate variables #
|
||||
#******************************************************************************#
|
||||
# Evaluate variables
|
||||
for var in prefix sysconfdir bindir libdir pkgdir includedir mandir; do
|
||||
eval $var'='$(eval 'echo $'$var)
|
||||
done
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
/libp7
|
||||
/libp7-dev
|
||||
/libp7-doc
|
||||
/tmp
|
||||
/files
|
||||
/libp7.debhelper.log
|
||||
/libp7.postinst.debhelper
|
||||
/libp7.postrm.debhelper
|
||||
/libp7.substvars
|
||||
/libp7-dev.debhelper.log
|
||||
/libp7-dev.substvars
|
||||
/libp7-doc.debhelper.log
|
||||
/libp7-doc.substvars
|
|
@ -0,0 +1,5 @@
|
|||
libg1m (1.0) stable; urgency=medium
|
||||
|
||||
* Initial release.
|
||||
|
||||
-- Thomas Touhey <thomas@touhey.fr> Wed, 04 Jan 2017 18:44:18 +0100
|
|
@ -0,0 +1 @@
|
|||
9
|
|
@ -0,0 +1,41 @@
|
|||
Standards-Version: 3.9.6
|
||||
Source: libg1m
|
||||
Priority: optional
|
||||
Maintainer: Thomas Touhey <thomas@touhey.fr>
|
||||
Section: libs
|
||||
Homepage: https://forge.touhey.fr/casio/lib/libg1m
|
||||
Build-Depends: debhelper (>= 9), make (>= 4.0), gcc (>= 4.9),
|
||||
binutils (>= 2.25), libc6 (>= 2.19), zlib1g-dev (>= 1.0),
|
||||
asciidoc (>= 8.6.9), gzip (>= 1.6)
|
||||
|
||||
Package: libg1m-1.0
|
||||
Section: libs
|
||||
Architecture: linux-any
|
||||
Multi-Arch: same
|
||||
Suggests: mcsfile
|
||||
Pre-Depends: ${misc:Pre-Depends}
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends},
|
||||
zlib1g (>= 1.0)
|
||||
Description: CASIO files parsing library
|
||||
Library for parsing CASIO files with a StandardHeader (usually g[1-3][a-z]).
|
||||
.
|
||||
This package contains the main shared library.
|
||||
|
||||
Package: libg1m-1.0-dev
|
||||
Section: libdevel
|
||||
Architecture: linux-any
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}, libg1m-1.0 (= ${binary:Version})
|
||||
Recommends: libg1m-1.0-doc
|
||||
Description: CASIO files parsing library development files
|
||||
Library for parsing CASIO files with a StandardHeader (usually g[1-3][a-z]).
|
||||
.
|
||||
This package contains C headers for libg1m.
|
||||
|
||||
Package: libg1m-1.0-doc
|
||||
Section: doc
|
||||
Architecture: all
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}
|
||||
Description: documentation for CASIO files parsing library
|
||||
Library for parsing CASIO files with a StandardHeader (usually g[1-3][a-z]).
|
||||
.
|
||||
This package contains the manpages for libg1m.
|
|
@ -0,0 +1,20 @@
|
|||
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||
Upstream-Name: libg1m
|
||||
Upstream-Contact: Thomas Touhey <thomas@touhey.fr>
|
||||
Source: https://forge.touhey.fr/casio/lib/libp7/
|
||||
|
||||
Files: *
|
||||
Copyright: © 2016 Thomas "CakeIsALie5" Touhey <thomas@touhey.fr>
|
||||
License: GPL-2
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
.
|
||||
On Debian systems, the complete text of the GPL license can be found
|
||||
in the /usr/share/common-licenses/GPL-2 file.
|
|
@ -0,0 +1,4 @@
|
|||
usr/bin/*
|
||||
usr/lib/**/libg1m.so
|
||||
usr/lib/**/pkgconfig/*.pc
|
||||
usr/include/libg1m-*/**/*
|
|
@ -0,0 +1 @@
|
|||
man/man1/libg1m-config.1
|
|
@ -0,0 +1 @@
|
|||
man/man3/*.3
|
|
@ -0,0 +1 @@
|
|||
usr/lib/**/libg1m.so.*
|
|
@ -0,0 +1,7 @@
|
|||
#!/usr/bin/make -f
|
||||
# uncomment if necessary - read debhelper(7) for more info
|
||||
#DH_VERBOSE = 1
|
||||
|
||||
# main packaging script, based on dh9 syntax
|
||||
%:
|
||||
dh $@
|
|
@ -0,0 +1,45 @@
|
|||
LIBG1M-CONFIG(1)
|
||||
================
|
||||
Thomas "Cakeisalie5" Touhey
|
||||
:Email: thomas@touhey.fr
|
||||
:man source: libg1m
|
||||
:man manual: libg1m manual
|
||||
|
||||
NAME
|
||||
----
|
||||
libg1m-config - script to get information about the installed version of libg1m
|
||||
|
||||
SYNOPSIS
|
||||
--------
|
||||
*libg1m-config* [--version] [--cflags] [--libs]
|
||||
|
||||
DESCRIPTION
|
||||
-----------
|
||||
*libg1m-config* is a tool that is used to configure and determine the compiler
|
||||
and linker flags that should be used to compile and link programs, libraries,
|
||||
and plugins that use libg1m.
|
||||
|
||||
OPTIONS
|
||||
-------
|
||||
*--cflags*::
|
||||
Print the compiler flags that are necessary to compile a program or library
|
||||
that uses libg1m.
|
||||
*--libs*::
|
||||
Print the linker flags that are necessary to link a program that
|
||||
uses libg1m.
|
||||
*--version*::
|
||||
Prints the currently installed version of libg1m on standard output.
|
||||
|
||||
EXAMPLES
|
||||
--------
|
||||
gcc -o main.o $(libg1m-config --cflags) main.c::
|
||||
is how you might use *libg1m-config* to compile a C source file for an
|
||||
executable program.
|
||||
gcc -o my_app $(libg1m-config --libs) main.o util.o::
|
||||
is how you might use *libg1m-config* to link compiled objects into an
|
||||
executable program.
|
||||
|
||||
SEE ALSO
|
||||
--------
|
||||
*libg1m*(3),
|
||||
*pkg-config*(1)
|
|
@ -30,7 +30,7 @@ const char *g1m_error_strings[] = {
|
|||
"given stream was not seekable",
|
||||
|
||||
[g1m_error_magic] =
|
||||
"magic/control problem",
|
||||
"is probably not a file libg1m can parse, or is corrupted",
|
||||
[g1m_error_eof] =
|
||||
"unexpected EOF",
|
||||
[g1m_error_alloc] =
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
|
||||
static const char version_message[] =
|
||||
"libg1m v" QUOTE(VERSION) " (licensed under GPLv2)\n"
|
||||
"Made by " QUOTE(AUTHOR) " <" QUOTE(AUTHOR_MAIL) ">.\n"
|
||||
"Maintained by " QUOTE(MAINTAINER) ".\n"
|
||||
"\n"
|
||||
"Compiled with the '" LLS "' loglevel.\n"
|
||||
"\n"
|
||||
|
|
|
@ -30,6 +30,24 @@ static uint32_t **fkeydup(uint8_t *fkey)
|
|||
return (pixels);
|
||||
}
|
||||
|
||||
/**
|
||||
* fkeydup3:
|
||||
* "Duplicate" function key for fx-CG.
|
||||
*
|
||||
* @arg fkey fkey to duplicate.
|
||||
* @return the "duplicated" function key.
|
||||
*/
|
||||
|
||||
static uint32_t **fkeydup3(uint8_t *fkey)
|
||||
{
|
||||
uint32_t **pixels = alloc_pixels(FKEY3_WIDTH, FKEY3_HEIGHT);
|
||||
if (!pixels) return (NULL);
|
||||
prepare_pixels(pixels, FKEY3_WIDTH, FKEY3_HEIGHT)
|
||||
|
||||
g1m_pixels_from_packed1bit(pixels, fkey, FKEY3_WIDTH, FKEY3_HEIGHT);
|
||||
return (pixels);
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* fx function keys file parsing utilities */
|
||||
/* ************************************************************************** */
|
||||
|
|
|
@ -149,6 +149,7 @@ int g1m_parse_c2p(g1m_t *handle, FILE *stream,
|
|||
(void)stream;
|
||||
/* TODO */
|
||||
log_info("C2P files are not managed yet.");
|
||||
log_info("Size is %zx", sizeof(struct c2p_subheader));
|
||||
|
||||
/* no error */
|
||||
return (0);
|
||||
|
|
Reference in New Issue