~ubuntu-branches/ubuntu/trusty/modem-manager-gui/trusty-backports

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
#!/bin/sh

#      configure
#      
#      Copyright 2012-2013 Alex <alex@linuxonly.ru>
#                     2013 Graham Inggs <graham@nerve.org.za>
#      
#      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.
#      
#      You should have received a copy of the GNU General Public License
#      along with this program. If not, see <http://www.gnu.org/licenses/>.


prefix=/usr
libpath=/usr/lib
prefixchanged=false
libpathchanged=false

cflags=$CFLAGS
if [ "x$cflags" = x ] ; then
    cflags='-mtune=native -O3'
fi

for arg_iter in "$@"; do
    arg=${arg_iter%%=*}
    arg_value=${arg_iter#*=}
    case $arg in
        --help)
echo "This script generates Modem Manager GUI configuration and build files. It also
checks if all dependencies are fulfilled.
Used without arguments, default settings are applied. Arguments are :
    --help : Display this message and exit.
    --prefix=PATH : Set PATH as file-system root for installation.
    --libdir=PATH : Set PATH as a directory for libraries.
    --cflags=PARAMETERS : Pass PARAMETERS to the compiler."
            exit 0;;

        --prefix)
            prefixchanged=true
            prefix=$(eval echo $arg_value);;

        --libdir)
            libpathchanged=true
            libpath=$(eval echo $arg_value);;

        --cflags)
            echo "Using : \"$arg_value\" as compilation options."
            cflags="$arg_value ";;

        
    esac
done

if $prefixchanged ; then
    if ! $libpathchanged ; then 
            libpath="$prefix/lib"
    fi
fi

echo -n "Checking depencies... "

if ! pkg-config  --print-errors --exists 'gtk+-3.0 >= 3.4.0'; then
  echo 'ERROR: Please install GTK+ version 3.4.0 or later'
  exit 1
fi

if ! test -e "/usr/include/gdbm/gdbm.h"; then
	if ! test -e "/usr/include/gdbm.h"; then
		echo 'ERROR: Please install GDBM library with development headers'
		exit 1
	fi
fi
echo done


echo -n "Generating Makefile_h... "
echo "#WARNING: Auto-generated file, edit with care.
CFLAGS := $cflags
LIBPATH := $libpath
PREFIX := $prefix" > Makefile_h
echo done

echo -n "Generating resources.h... "
echo "/*
 *      resources.h
 *      
 *      Copyright 2012 Alex <alex@linuxonly.ru>
 *      
 *      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.
 *      
 *      You should have received a copy of the GNU General Public License
 *      along with this program. If not, see <http://www.gnu.org/licenses/>.
 */

/* WARNING: Auto-generated file, edit with care. */

#ifndef __RESOURCES_H__
#define __RESOURCES_H__

#define RESOURCE_MAINWINDOW_ICON         \"$prefix/share/pixmaps/modem-manager-gui.png\"
#define RESOURCE_MAINWINDOW_UI           \"$prefix/share/modem-manager-gui/ui/modem-manager-gui.ui\"

#define RESOURCE_TOOLBAR_DEV             \"$prefix/share/modem-manager-gui/pixmaps/dev-tb.png\"
#define RESOURCE_TOOLBAR_SMS             \"$prefix/share/modem-manager-gui/pixmaps/sms-tb.png\"
#define RESOURCE_TOOLBAR_USSD            \"$prefix/share/modem-manager-gui/pixmaps/ussd-tb.png\"
#define RESOURCE_TOOLBAR_INFO            \"$prefix/share/modem-manager-gui/pixmaps/info-tb.png\"
#define RESOURCE_TOOLBAR_SCAN            \"$prefix/share/modem-manager-gui/pixmaps/scan-tb.png\"
#define RESOURCE_TOOLBAR_CONT            \"$prefix/share/modem-manager-gui/pixmaps/cont-tb.png\"
#define RESOURCE_TOOLBAR_TRAFFIC         \"$prefix/share/modem-manager-gui/pixmaps/traffic-tb.png\"
#define RESOURCE_SMS_READ                \"$prefix/share/modem-manager-gui/pixmaps/sms-read.png\"
#define RESOURCE_SMS_UNREAD              \"$prefix/share/modem-manager-gui/pixmaps/sms-unread.png\"
#define RESOURCE_MESSAGE_RECIEVED        \"$prefix/share/modem-manager-gui/pixmaps/message-received.png\"
#define RESOURCE_MESSAGE_SENT            \"$prefix/share/modem-manager-gui/pixmaps/message-sent.png\"
#define RESOURCE_MESSAGE_DRAFTS          \"$prefix/share/modem-manager-gui/pixmaps/message-drafts.png\"
#define RESOURCE_INFO_EQUIPMENT          \"$prefix/share/modem-manager-gui/pixmaps/info-equipment.png\"
#define RESOURCE_INFO_NETWORK            \"$prefix/share/modem-manager-gui/pixmaps/info-network.png\"
#define RESOURCE_INFO_LOCATION           \"$prefix/share/modem-manager-gui/pixmaps/info-location.png\"

#define RESOURCE_SOUND_MESSAGE           \"$prefix/share/modem-manager-gui/sounds/message.ogg\"

#define RESOURCE_DESKTOP_FILE            \"/usr/share/applications/modem-manager-gui.desktop\"

#define RESOURCE_MODULES_DIR             \"$libpath/modem-manager-gui/modules/\"

#define RESOURCE_LOCALE_DIR              \"$prefix/share/locale/\"
#define RESOURCE_LOCALE_DOMAIN           \"modem-manager-gui\"

#endif // __RESOURCES_H__" > src/resources.h
echo done

echo -n "Generating launcher... "
echo "
[Desktop Entry]
Name=Modem Manager GUI
GenericName=Modem Manager GUI
Comment=Graphical interface for Modem manager daemon control
Comment[ru]=Программа для управления специфическими функциями EDGE/3G/4G модемов
Comment[uz]=EDGE/3G/4G modemning o'ziga xos vazifalarini boshqarish vositasi
Comment[uk]=Інструмент для керування специфічними функціями EDGE/3G/4G модемів
Comment[pt_BR]=Ferramenta para controle de funções específicas de modem EDGE/3G/4G
Comment[tr]=EDGE/3G/4G modemler için özel işlev kontrol aracı
Comment[id]=Perangkat lunak untuk mengendalikan fungsi spesifik modem EDGE/3G/4G
Exec=$prefix/bin/modem-manager-gui
Icon=$prefix/share/pixmaps/modem-manager-gui.png
Terminal=false
Type=Application
Categories=System;" > resources/modem-manager-gui.desktop
echo done