Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

diff-files. How to update?

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
User avatar
Grimnar
Posts: 173
Joined: 2008-03-30 16:24

diff-files. How to update?

#1 Post by Grimnar »

So I got a diff-file from a debian maintainer, to fix my awstats in squeeze. But I really dont know how to use it?
Can someone help me out on this please?

Code: Select all

diff --git a/debian/awstats.install b/debian/awstats.install
index b88f4c7..9319508 100644
--- a/debian/awstats.install
+++ b/debian/awstats.install
@@ -5,6 +5,8 @@ wwwroot/cgi-bin/awstats.pl	usr/lib/cgi-bin/
 wwwroot/cgi-bin/lang/*		usr/share/awstats/lang/
 wwwroot/cgi-bin/lib/*		usr/share/awstats/lib/
 wwwroot/cgi-bin/plugins/*.pm	usr/share/awstats/plugins/
+wwwroot/classes/awgraphapplet.jar usr/share/awstats/classes/
+wwwroot/classes/src/AWGraphApplet.class usr/share/awstats/classes/
 wwwroot/icon/*			usr/share/awstats/icon/
 debian/update.sh	usr/share/awstats/tools/
 tools/awstats_buildstaticpages.pl	usr/share/awstats/tools/
diff --git a/debian/control.in b/debian/control.in
index 3fb0cdb..11bcaf9 100644
--- a/debian/control.in
+++ b/debian/control.in
@@ -3,7 +3,7 @@ Section: web
 Priority: optional
 Maintainer: Debian AWStats Team <pkg-awstats-devel@lists.alioth.debian.org>
 Uploaders: Andreas Henriksson <andreas@fatal.se>, Charles Fry <cfry@debian.org>, Jonas Smedegaard <dr@jones.dk>, Sergey B Kirpichev <skirpichev@gmail.com>
-Build-Depends: @cdbs@
+Build-Depends: @cdbs@, openjdk-6-jdk
 Vcs-Git: git://git.debian.org/git/collab-maint/awstats.git
 Vcs-Browser: http://git.debian.org/?p=collab-maint/awstats.git;a=summary
 Standards-Version: 3.8.1
diff --git a/debian/examples/apache.conf b/debian/examples/apache.conf
index cde703f..5ab8120 100644
--- a/debian/examples/apache.conf
+++ b/debian/examples/apache.conf
@@ -21,10 +21,24 @@
 	Allow from all
 </Directory>
 
+# This provides worldwide access to everything below the directory
+# Security concerns: none known
+<Directory /usr/share/awstats/classes>
+	Options None
+	AllowOverride None
+	Order allow,deny
+	Allow from all
+</Directory>
+
+
 # This provides worldwide access to everything in the directory
 # Security concerns: none known
 Alias /awstats-icon/ /usr/share/awstats/icon/
 
+# This provides worldwide access to everything in the directory
+# Security concerns: none known
+Alias /awstatsclasses/ /usr/share/awstats/classes/
+
 # This (hopefully) enables _all_ CGI scripts in the default directory
 # Security concerns: Are you sure _all_ CGI scripts are safe?
 ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
diff --git a/debian/rules b/debian/rules
index b2ba1d9..aa96d44 100755
--- a/debian/rules
+++ b/debian/rules
@@ -44,6 +44,7 @@ DEB_COMPRESS_EXCLUDE = $(notdir $(awstats_example_scripts)) awstats.ico
 
 pre-build::
 	(cd debian/icons && uudecode firefox.png.uu)
+	(cd wwwroot/classes/src/ && perl Makefile.pl)
 
 common-configure-indep::
 	# Use perl rather than a diff here, to make sure all relevant
@@ -71,6 +72,8 @@ common-configure-indep::
 
 clean::
 	rm -f debian/awstats.conf debian/icons/firefox.png
+	rm -f wwwroot/classes/awgraphapplet.jar
+	rm -f wwwroot/classes/src/AWGraphApplet.class
 
 # Remove badly coded PDF, and .cvsignore
 binary-post-install/awstats::

User avatar
bugsbunny
Posts: 5354
Joined: 2008-07-06 17:04
Been thanked: 1 time

Re: diff-files. How to update?

#2 Post by bugsbunny »

see "man patch"

Basically you go to the root of the source directory then you would run the patch command. So if your source is installed into ~/source/program and your patch file is in ~/source/patches/patchfile you could run:

cd ~/source/program

Code: Select all

patch -p1 -i ~/source/patches/patchfile --dry-run
to test the patch and make sure it applies correctly. If that gets no errors you would remove the --dry-run parameter and run it for real (what dry-run does should be obvious from the name).

There's some other formats you may see but they all do basically the same thing.

Code: Select all

cat ~/source/patches/patchfile | patch -p1

Code: Select all

patch -p1 < ~/source/patches/patchfile
The last is probably the most common. --dry-run would go before the <

User avatar
Grimnar
Posts: 173
Joined: 2008-03-30 16:24

Re: diff-files. How to update?

#3 Post by Grimnar »

Great, that got me a bit closer. All though I have no clue what/where the source file to awstats is. It was installed using apt-get :wink:

User avatar
bugsbunny
Posts: 5354
Joined: 2008-07-06 17:04
Been thanked: 1 time

Re: diff-files. How to update?

#4 Post by bugsbunny »

OK, we'll try a fairly simple method. There are other ways to do this.

Make sure that you have deb-src lines in /etc/apt/sources.list
Just take all the lines that start with "deb ", duplicate them but start with "deb-src ". That will enable you to download source code.

I prefer aptitude so will use that in examples where possible. You can use apt-get instead if you insist.

Code: Select all

# aptitude update
# aptitude install build-essential fakeroot devscripts openjdk-6-jdk
# aptitude build-dep awstats
The last line will install build dependencies for awstats. I had you install openjdk-6-jdk in the first line because looking at the patch file he added that to the build dependency list.

Now, as a regular user (not root):

Code: Select all

mkdir -p ~/source/awstats
cd ~/source/awstats
apt-get source awstats
cd awstats<whatever the rest of the directory name is, just use tab to autocomplete>
apply patch as mentioned previously

Code: Select all

dch --local .patched
That will modify the version number in the changelog and add an appropriate entry at the top of the file. It will drop you into an editor (probably nano) to allow you to verify the changes. Assuming it includes a correctly formatted email address (not sure what would happen with a bad one) just exit out of the editor by (assuming nano):
Ctrl+o
enter
Ctrl+x
(you should become familiar with nano in case you ever need an editor in cli mode).
Now compile the package:

Code: Select all

dpkg-buildpackage -rfakeroot -b -us -uc
once it finishes (assuming everything compiles correctly) you should find deb files in the parent of the source tree (~/source/awstats with the way I laid things out), which you can then install with dpkg -i

The above is untested (partially) but I think I covered pretty much everything, and got it right. Or at least I hope I did :) Good luck!

User avatar
Grimnar
Posts: 173
Joined: 2008-03-30 16:24

Re: diff-files. How to update?

#5 Post by Grimnar »

Thanks for the big extensive explanation! I will look into as soon as I can get a ssh-connection:)

User avatar
Grimnar
Posts: 173
Joined: 2008-03-30 16:24

Re: diff-files. How to update?

#6 Post by Grimnar »

And now I got a different problem to solve as well.
Image

My /dev (udev) is full, so I cant do sh** on my system until that is solved.

Post Reply