Added autotools build system.

This commit is contained in:
Marcel Metz
2013-05-25 16:49:48 +02:00
parent 9bec1a9898
commit 3c8b85528c
16 changed files with 206 additions and 12 deletions

14
.gitignore vendored
View File

@@ -1,2 +1,14 @@
gschemas.compiled
*~
*.swp
autom4te.cache
configure
Makefile.in
Makefile
sensors.shell-extension.zip
gnome-shell-extension-sensors-1.3.tar.gz
gnome-shell-extension-sensors-1.3.tar.xz
aclocal.m4
config.log
config.status
.build/
ChangeLog

40
Makefile.am Normal file
View File

@@ -0,0 +1,40 @@
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
SUBDIRS = src data
uuid = "temperature@xtranophilist"
localprefix = $(HOME)/.local/share/gnome-shell/extensions
zip-file: sensors.shell-extension.zip
sensors.shell-extension.zip: all
$(MKDIR_P) $(builddir)/.build
$(MAKE) install DESTDIR="$(abs_builddir)/.build"
$(AM_V_at)cp -r "$(builddir)/.build$(datadir)/gnome-shell/extensions/$(uuid)" "$(builddir)/.build"
if [ -f "$(builddir)/.build$(datadir)/glib-2.0/schemas/org.gnome.shell.extensions.sensors.gschema.xml" ]; then \
$(MKDIR_P) "$(builddir)/.build/$(uuid)/schemas"; \
mv "$(builddir)/.build$(datadir)/glib-2.0/schemas/org.gnome.shell.extensions.sensors.gschema.xml" "$(builddir)/.build/$(uuid)/schemas"; \
glib-compile-schemas "$(builddir)/.build/$(uuid)/schemas"; \
fi; \
cp -r "$(builddir)/.build$(datadir)/locale" "$(builddir)/.build/$(uuid)"; \
(cd "$(builddir)/.build/$(uuid)/"; \
zip -qr "$(abs_builddir)/sensors.shell-extension.zip" .; \
);
clean-local:
$(AM_V_at)-rm -rf $(builddir)/sensors.shell-extension.zip
distclean-local:
$(AM_V_at)-rm -rf $(builddir)/.build
local-install: sensors.shell-extension.zip
zip_file="$(abs_builddir)/sensors.shell-extension.zip"; \
if [ -d "$(localprefix)/$(uuid)" ]; then \
rm -fR "$(localprefix)/$(uuid)"; \
fi; \
$(MKDIR_P) $(localprefix)/$(uuid); \
(cd $(localprefix)/$(uuid); \
unzip -q $${zip_file}; \
);

View File

@@ -14,6 +14,8 @@ Optionally, this extension uses [hddtemp] to read hard drive temperature data.
Installation
=============
This is the **recommended method** for installation, as it doesn't require the build
dependencies for installation.
You can install this extension by visiting the [GNOME extensions]
page for this extension.
@@ -27,18 +29,33 @@ Fedora has packaged an older version of this extension. You can install it by ru
Manual installation
-------------------
This is the **recommended method** for installation as you always get the latest version.
To install this extension you need to clone the source and build the extension.
The build dependenciesare:
* *gettext*,
* *pkg-config*,
* *git*,
* *glib2*,
* *glib2-devel* or *libglib2.0-dev*,
* *zip*,
* *gnome-common*,
* *autoconf*,
* *automake*,
* *intltool*.
To build the extension please run the following commands:
cd ~ && git clone https://github.com/xtranophilist/gnome-shell-extension-sensors.git
cd ~/gnome-shell-extension-sensors
./autogen.sh
You can install this extension for your user by executing:
cd ~/.local/share/gnome-shell/extensions
git clone https://github.com/xtranophilist/gnome-shell-extension-sensors.git temperature@xtranophilist
glib-compile-schemas temperature@xtranophilist/schemas/
make local-install
or system wide by executing (this requires root permissions):
cd /usr/share/gnome-shell/extensions/
git clone https://github.com/xtranophilist/gnome-shell-extension-sensors.git temperature@xtranophilist
glib-compile-schemas temperature@xtranophilist/schemas/
make install
After installation you need to restart the GNOME shell:

22
autogen.sh Executable file
View File

@@ -0,0 +1,22 @@
#!/bin/bash
# Run this to generate all the initial makefiles, etc.
srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.
PKG_NAME="gnome-shell-extension-sensors"
touch ChangeLog
test -f $srcdir/configure.ac || {
echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
echo " top-level gnome-shell-extensions directory"
exit 1
}
which gnome-autogen.sh || {
echo "You need to install gnome-common from GNOME Git (or from"
echo "your OS vendor's package manager)."
exit 1
}
. gnome-autogen.sh

2
config/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
install-sh
missing

57
configure.ac Normal file
View File

@@ -0,0 +1,57 @@
AC_PREREQ(2.63)
dnl be carefull, the version needs to be in sync with your gnome shell version
AC_INIT([gnome-shell-extension-sensors],[1.3],[https://github.com/xtranophilist/gnome-shell-extension-sensorsi/issues])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_AUX_DIR([config])
AM_INIT_AUTOMAKE([1.10 dist-xz foreign])
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
AC_PROG_SED
PKG_PROG_PKG_CONFIG([0.22])
GLIB_GSETTINGS
AC_ARG_WITH(desktop-dir, [ --with-desktop-dir=PATH where to install desktop files (default=PREFIX/share)])
if test "x$with_desktop_dir" != x; then
DESKTOP_DATADIR=$with_desktop_dir
else
DESKTOP_DATADIR="$datadir"
fi
AM_CONDITIONAL(DESKTOP_DATADIR, test "x$with_desktop_dir" != xno)
AC_SUBST(DESKTOP_DATADIR)
AC_ARG_WITH([local-install],
[AS_HELP_STRING([--with-local-install],
[install schemas and translations in a subdir of the extension (default is no)])],
[use_local_install=$withval],
[use_local_install=no])
AC_SUBST(use_local_install)
AM_CONDITIONAL(LOCAL_INSTALL, test "x${use_local_install}" == "xyes")
extensiontopdir=${datadir}/gnome-shell/extensions/weather@gnome-shell-extensions.gnome.org
dnl This is beyond ugly. Suggestions accepted.
if test "x${use_local_install}" == "xyes"; then
AC_SUBST(gsettingsschemadir, [${extensiontopdir}/schemas])
fi
dnl Please keep this sorted alphabetically.
AC_CONFIG_FILES([
Makefile
data/Makefile
src/Makefile
])
AC_OUTPUT
if test "x$use_local_install" == "xyes"; then
echo
echo "The schemas will be installed in subdirectories of the extension."
echo
fi

3
data/.gitignore vendored Normal file
View File

@@ -0,0 +1,3 @@
org.gnome.shell.extensions.sensors.gschema.valid
org.gnome.shell.extensions.sensors.gschema.xml
metadata.json

29
data/Makefile.am Normal file
View File

@@ -0,0 +1,29 @@
extensionurl = https://github.com/xtranophilist/gnome-shell-extension-sensors
# Change these to modify how installation is performed
topextensiondir = $(datadir)/gnome-shell/extensions
uuid = temperature@xtranophilist
extensiondir = $(topextensiondir)/$(uuid)
nodist_extension_DATA = metadata.json $(EXTRA_EXTENSION)
EXTRA_DIST = metadata.json.in
metadata.json: metadata.json.in $(top_builddir)/config.status
$(AM_V_GEN) sed -e "s|[@]LOCALEDIR@|$(datadir)/locale|" \
-e "s|[@]GETTEXT_PACKAGE@|$(GETTEXT_PACKAGE)|" \
-e "s|[@]uuid@|$(uuid)|" \
-e "s|[@]url@|$(extensionurl)|" $< > $@
CLEANFILES = metadata.json
gschemas_in = org.gnome.shell.extensions.sensors.gschema.xml.in
@INTLTOOL_XML_NOMERGE_RULE@
gsettings_SCHEMAS = $(gschemas_in:.xml.in=.xml) @GSETTINGS_RULES@
EXTRA_DIST += $(gschemas_in)
CLEANFILES += $(gschemas_in:.xml.in=.valid) $(gsettings_SCHEMAS)

View File

@@ -2,13 +2,14 @@
"description": "Shows CPU temperature, HDD temperature, voltage and fan RPM",
"name": "Sensors",
"settings-schema": "org.gnome.shell.extensions.sensors",
"gettext-domain": "gse-sensors",
"gettext-domain": "@GETTEXT_PACKAGE@",
"shell-version": [
"3.2",
"3.4",
"3.6",
"3.8"
],
"url": "https://github.com/xtranophilist/gnome-shell-extension-sensors",
"uuid": "temperature@xtranophilist"
],
"localedir": "@LOCALEDIR@",
"url": "@url@",
"uuid": "@uuid@"
}

1
m4/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
intltool.m4

10
src/Makefile.am Normal file
View File

@@ -0,0 +1,10 @@
# Change these to modify how installation is performed
topextensiondir = $(datadir)/gnome-shell/extensions
uuid = temperature@xtranophilist
extensiondir = $(topextensiondir)/$(uuid)
dist_extension_DATA = extension.js convenience.js prefs.js utilities.js
nodist_extension_DATA = $(EXTRA_EXTENSION)