~grubng-dev/grubng/clients-csharp

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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
<?xml version="1.0"?>
    <project name="Grub Next Generation" default="build" basedir=".">
        <description>Grub Next Generation C# client.</description>
	<property name="version" value="0.9.1" overwrite="false" />
	<property name="prefix" value="/usr" />
	<property name="debug" value="true" />
	<property name="target" value="unix" />
        <target name="clean" description="remove all generated files">
	    <delete dir="bin" failonerror="false" />
        </target>
        <target name="build" description="compiles source code">
	    <mkdir dir="bin" />
	    <csc target="library" output="bin/grubng-sharp.dll" debug="${debug}" 
		 optimize="true" codepage="utf8">
              <sources>
                  <include name="grubng-sharp/**/*.cs" />
              </sources>
	      <references>
		  <include name="System.dll" />
		  <include name="System.Xml.dll" />
	      </references>
	    </csc>
	    <if test="${target!='library'}">
		<if test="${target!='console'}">
	            <mkdir dir="bin/Images" />
		    <copy todir="bin/Images">
	                <fileset basedir="Grubng/Images">
		            <include name="*.*" />
		        </fileset>
		    </copy>
		</if>
		<copy todir="bin">
	            <fileset basedir="Grubng">
		        <include name="README.txt" />
			<include name="COPYING" />
			<include name="ChangeLog" />
			<include name="AUTHORS" />
		    </fileset> 
		</copy>
	        <mkdir dir="bin/locale/nl/LC_MESSAGES" />	    	  
		<exec program="msgfmt">
	            <arg value="Grubngtranslations/nl.po" />
		    <arg value="-o" />
		    <arg value="bin/locale/nl/LC_MESSAGES/grubng.mo" />
		</exec>
		<mkdir dir="bin/locale/de/LC_MESSAGES" />
		<exec program="msgfmt">
	            <arg value="Grubngtranslations/de.po" />
		    <arg value="-o" />
		    <arg value="bin/locale/de/LC_MESSAGES/grubng.mo" />
		</exec>
		<mkdir dir="bin/locale/en/LC_MESSAGES" />
		<exec program="msgfmt">
	            <arg value="Grubngtranslations/en.po" />
		    <arg value="-o" />
		    <arg value="bin/locale/en/LC_MESSAGES/grubng.mo" />
		</exec>
		<mkdir dir="bin/locale/fi/LC_MESSAGES" />
		<exec program="msgfmt">
	            <arg value="Grubngtranslations/fi.po" />
		    <arg value="-o" />
		    <arg value="bin/locale/fi/LC_MESSAGES/grubng.mo" />
		</exec>
		<mkdir dir="bin/locale/pl/LC_MESSAGES" />	    	  
		<exec program="msgfmt">
	            <arg value="Grubngtranslations/pl.po" />
		    <arg value="-o" />
		    <arg value="bin/locale/pl/LC_MESSAGES/grubng.mo" />
		</exec>
		<mkdir dir="bin/locale/es/LC_MESSAGES" />
		<exec program="msgfmt">
	            <arg value="Grubngtranslations/es.po" />
		    <arg value="-o" />
		    <arg value="bin/locale/es/LC_MESSAGES/grubng.mo" />
		</exec>
		<mkdir dir="bin/locale/gl/LC_MESSAGES" />
		<exec program="msgfmt">
	            <arg value="Grubngtranslations/gl.po" />
		    <arg value="-o" />
		    <arg value="bin/locale/gl/LC_MESSAGES/grubng.mo" />
		</exec>
		<mkdir dir="bin/locale/fr/LC_MESSAGES" />
		<exec program="msgfmt">
	            <arg value="Grubngtranslations/fr.po" />
		    <arg value="-o" />
		    <arg value="bin/locale/fr/LC_MESSAGES/grubng.mo" />
		</exec>
	    </if>
	    <if test="${target=='unix'}">
		<csc target="winexe" output="bin/Grubng.exe" debug="${debug}" 
		     optimize="true" codepage="utf8">
                    <sources>
                        <include name="Grubng/*.cs" />
			<exclude name="Grubng/MainWindows.cs" />
			<exclude name="Grubng/Main.cs" />
			<exclude name="Grubng/MainConsole.cs" />
			<include name="Grubng/gtk-gui/*.cs" />
			<include name="Grubng/Console/*.cs" />
			<include name="Grubng/GTK/*.cs" />
                    </sources>
		    <references>
		        <include name="gtk-sharp.dll" />
			<include name="gdk-sharp.dll" />
			<include name="glib-sharp" />
			<include name="pango-sharp.dll" />
			<include name="Mono.Posix.dll" />
			<include name="System.dll" />
			<include name="System.Xml.dll" />
			<include name="bin/grubng-sharp.dll" />
		    </references>
		    <pkg-references>
		        <package name="gtk-sharp-2.0" />
		    </pkg-references>
		</csc>
	    </if>
	    <if test="${target=='windows'}">
                <csc target="winexe" output="bin/Grubng.exe" debug="${debug}" 
		     optimize="true" codepage="utf8">
                    <sources>
                        <include name="Grubng/*.cs" />
			<exclude name="Grubng/Main.cs" />
			<exclude name="Grubng/MainUnix.cs" />
			<exclude name="Grubng/MainConsole.cs" />
			<include name="Grubng/WinForm/*.cs" />
			<include name="Grubng/Console/*.cs" />
                    </sources>
		    <references>
			<include name="System.dll" />
			<include name="System.Xml.dll" />
			<include name="System.Data.dll" />
			<include name="System.Drawing.dll" />
			<include name="System.Windows.Forms" />
			<include name="Mono.Posix.dll" />
			<include name="bin/grubng-sharp.dll" />
		    </references>
		    <pkg-references>
		        <package name="dotnet" />
		    </pkg-references>
		</csc>
	    </if>
	    <if test="${target=='console'}">
		<csc target="winexe" output="bin/Grubng.exe" debug="${debug}" 
		     optimize="true" codepage="utf8">
                    <sources>
                        <include name="Grubng/*.cs" />
			<exclude name="Grubng/MainWindows.cs" />
			<exclude name="Grubng/Main.cs" />
			<exclude name="Grubng/MainUnix.cs" />
			<include name="Grubng/Console/*.cs" />
                    </sources>
		    <references>
			<include name="Mono.Posix.dll" />
			<include name="System.dll" />
			<include name="System.Xml.dll" />
			<include name="bin/grubng-sharp.dll" />
		    </references>
		</csc>
	    </if>
        </target>
	<target name="tarball" description="create tar.gz with source code">
	    <tar destfile="grubng-${version}.tar.gz" compression="GZip">
	        <fileset prefix="grubng-${version}">
		    <include name="**/*" />
		</fileset>
	    </tar>
	</target>
	<target name="zip" description="create .zip file with binaries">
	    <zip zipfile="grubng-${version}.zip">
	    	 <fileset basedir="bin" prefix="grubng-${version}">
		     <include name="**/*" />
		 </fileset>
	    </zip>
	</target>
	<target name="install" description="install program in selected dir (only Unix systems)">
	    <mkdir dir="${prefix}/lib/grubng/Images" />
	    <mkdir dir="${prefix}/lib/grubng/locale/de/LC_MESSAGES" />
	    <mkdir dir="${prefix}/lib/grubng/locale/en/LC_MESSAGES" />
	    <mkdir dir="${prefix}/lib/grubng/locale/pl/LC_MESSAGES" />
	    <mkdir dir="${prefix}/lib/grubng/locale/nl/LC_MESSAGES" />
	    <mkdir dir="${prefix}/lib/grubng/locale/fi/LC_MESSAGES" />
	    <mkdir dir="${prefix}/lib/grubng/locale/es/LC_MESSAGES" />
	    <mkdir dir="${prefix}/lib/grubng/locale/gl/LC_MESSAGES" />
	    <mkdir dir="${prefix}/lib/grubng/locale/fr/LC_MESSAGES" />
	    <copy todir="${prefix}/lib/grubng">
	        <fileset basedir="bin">
		    <include name="**/*" />
		    <exclude name="Grubng.exe.mdb" />
		</fileset>
	    </copy>
	    <mkdir dir="${prefix}/bin" />
            <copy todir="${prefix}/bin/">
	      <fileset basedir="Grubng">
		<include name="grubng" />
	      </fileset>
	    </copy>
	    <echo message="Set permissions to run grubng script file." />
	    <exec program="chmod">
	      <arg value="755" />
	      <arg value="${prefix}/bin/grubng" />
	    </exec>
	    <mkdir dir="${prefix}/share/applications" />
	    <copy file="Grubng/grub.desktop" tofile="${prefix}/share/applications/grub.desktop" />>
	</target>
	<target name="uninstall" description="uninstall program (only Unix systems)">
	    <delete dir="${prefix}/grubng" failonerror="false" />
	    <if test="${prefix=='/usr'}">
	        <delete file="/usr/bin/grubng"/>
		<delete file="/usr/share/applications/grub.desktop" />
		<delete dir="${prefix}/lib/grubng" failonerror="false" />
	    </if>
	</target>
    </project>