--- mp3rename-0.6.orig/Makefile +++ mp3rename-0.6/Makefile @@ -2,6 +2,7 @@ SRCS = mp3rename.c OBJS = mp3rename.o RM = /bin/rm +INSTALL = /usr/bin/install all: mp3rename @@ -12,6 +13,4 @@ $(RM) -f $(OBJS) $(PROG) *~ *core install: - $(INSTALL) -c mp3rename $(PREFIX)/bin/mp3rename - $(INSTALL) -c mp3rename.1.gz $(PREFIX)/man/man1/ - \ No newline at end of file + $(INSTALL) -D mp3rename $(PREFIX)/usr/bin/mp3rename --- mp3rename-0.6.orig/debian/README.Debian +++ mp3rename-0.6/debian/README.Debian @@ -0,0 +1,33 @@ +mp3rename +--------- + +$ mp3rename -h +Usage: + +Mp3rename 0.6 + +Options: + -f Force non id3 rename. + -v Verbose mode. + -h Display this help message. + -b Limit the file size to 32 chars. + -i Only show the id3tags. + -a Ask everything for the id3tag. + + -s Set the default filename look. + for more help on this option: -s help + +Sander Janssen + +$ mp3rename -s help +Mp3rename 0.6 + + Use this option to set the default look of the file + The information is saved in ~/.mp3rename + You can use &t title, &b album, &y year, &k track and &a artist + + Example : mp3rename -s '(&a)-&t-&b' + for (artist)-title-album.mp3 + + + --- Mark Purcell --- mp3rename-0.6.orig/debian/changelog +++ mp3rename-0.6/debian/changelog @@ -0,0 +1,77 @@ +mp3rename (0.6-10) unstable; urgency=medium + + * QA upload. + * Ack for NMU. + * Add {misc:Depends} to Depends field. + * Bump DH level to 10. (Closes: #800274) + * Bump Standards-Version to 3.9.8. + * debian/watch: added a fake site to explain about + the current status of the original upstream homepage. + * Set QA Group as maintainer. (see #839972) + + -- Allan Dixon Jr. Sun, 06 Nov 2016 06:14:29 -0500 + +mp3rename (0.6-9) unstable; urgency=low + + * Apply patch from David Whitmarsh + - should be able to zero pad the track number so it sorts bett + (Closes: #272221) + * Lintian cleanup debian/copyright + * DEBHELPER compat ver 3 + + -- Mark Purcell Thu, 1 Sep 2005 21:45:05 +0100 + +mp3rename (0.6-8) unstable; urgency=low + + * Improve Package description (Closes: Bug#209942) + + -- Mark Purcell Wed, 10 Sep 2003 22:57:43 +1000 + +mp3rename (0.6-7) unstable; urgency=low + + * Apply ID3v2 patch from Niki "K.-M. Hansche" (Closes: Bug#130459, Bug#91906) + * lintian cleanup copyright-lists-upstream-authors-with-dh_make- + boilerplate + + -- Mark Purcell Sun, 6 Jul 2003 21:49:04 +1000 + +mp3rename (0.6-6) unstable; urgency=low + + * Fixup help2man path + + -- Mark Purcell Mon, 8 Apr 2002 20:51:43 +1000 + +mp3rename (0.6-5) unstable; urgency=low + + * lintian cleanup. Added man page mp3rename(1) + + -- Mark Purcell Sun, 7 Apr 2002 21:57:30 +1000 + +mp3rename (0.6-4) unstable; urgency=low + + * Extra else in Gun patch (Closes: Bug#124475) + + -- Mark Purcell Thu, 27 Dec 2001 21:46:45 +1100 + +mp3rename (0.6-3) unstable; urgency=low + + * Added Alexander Gun patch to fix track numbers (Closes: Bug#124475) + + -- Mark Purcell Sun, 23 Dec 2001 20:12:01 +1100 + +mp3rename (0.6-2) unstable; urgency=low + + * Document usage parameters in README.Debian (Closes: #91902, #91905) + * Include partial track number support patch. (Closes: #112382) Thanks Marcin Owsiany + + -- Mark Purcell Mon, 17 Sep 2001 20:50:50 +1000 + +mp3rename (0.6-1) unstable; urgency=low + + * Initial Release. Closes: bug#90096 + + -- Mark Purcell Fri, 23 Feb 2001 22:28:22 +1100 + +Local variables: +mode: debian-changelog +End: --- mp3rename-0.6.orig/debian/compat +++ mp3rename-0.6/debian/compat @@ -0,0 +1 @@ +10 --- mp3rename-0.6.orig/debian/control +++ mp3rename-0.6/debian/control @@ -0,0 +1,15 @@ +Source: mp3rename +Section: sound +Priority: optional +Maintainer: Debian QA Group +Build-Depends: debhelper (>= 10), help2man +Standards-Version: 3.9.8 + +Package: mp3rename +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Rename mp3 files based on id3tags + Mp3rename is a small tool to rename all those badly named mp3 files. + . + The generated file name can be based on the id3tags; title, album, + year, track and/or artist. --- mp3rename-0.6.orig/debian/copyright +++ mp3rename-0.6/debian/copyright @@ -0,0 +1,37 @@ +This package was debianized by Mark Purcell on +Fri, 23 Feb 2001 22:28:22 +1100. + +It was downloaded from http://www.rendo.dekooi.nl/~janssen/mp3rename-0.6.tar.gz + +Copyright Holder: + +/* + * mp3rename.c + * + * Sander Janssen + * + * This software is covered by the GNU public license, + * which should be in a file named LICENSE acompanying + * this. + * + */ + +License: + + This package 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 2 of the License, or + (at your option) any later version. + + This package 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 package; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +On Debian systems, the complete text of the GNU General +Public License can be found in `/usr/share/common-licenses/GPL'. + --- mp3rename-0.6.orig/debian/dirs +++ mp3rename-0.6/debian/dirs @@ -0,0 +1 @@ +usr/bin --- mp3rename-0.6.orig/debian/docs +++ mp3rename-0.6/debian/docs @@ -0,0 +1 @@ +README --- mp3rename-0.6.orig/debian/rules +++ mp3rename-0.6/debian/rules @@ -0,0 +1,88 @@ +#!/usr/bin/make -f +# Sample debian/rules that uses debhelper. +# GNU copyright 1997 to 1999 by Joey Hess. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +# This is the debhelper compatability version to use. +#export DH_COMPAT=3 + +configure: configure-stamp +configure-stamp: + dh_testdir + # Add here commands to configure the package. + + + touch configure-stamp + +build: configure-stamp build-stamp +build-stamp: + dh_testdir + + # Add here commands to compile the package. + $(MAKE) + #/usr/bin/docbook-to-man debian/mp3rename.sgml > mp3rename.1 + /usr/bin/help2man -h -h -v '-s help' -S 'Debian GNU/Linux' \ + -N -o mp3rename.1 -n 'Rename mp3 files based on id3tags' \ + ./mp3rename + + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp + + # Add here commands to clean up after the build process. + -$(MAKE) clean + rm -f mp3rename.1 + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + # Add here commands to install the package into debian/mp3rename. + $(MAKE) install PREFIX=$(CURDIR)/debian/mp3rename + + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot +# dh_installdebconf + dh_installdocs +# dh_installexamples +# dh_installmenu +# dh_installemacsen +# dh_installpam +# dh_installinit +# dh_installcron + dh_installman mp3rename.1 +# dh_installinfo +# dh_undocumented mp3rename.1 + dh_installchangelogs + dh_link + dh_strip + dh_compress + dh_fixperms + # You may want to make some executables suid here. +# dh_suidregister +# dh_makeshlibs + dh_installdeb +# dh_perl + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure --- mp3rename-0.6.orig/debian/watch +++ mp3rename-0.6/debian/watch @@ -0,0 +1,3 @@ +version=4 +opts=dversionmangle=s/.*/0.No-Site/ \ +https://people.debian.org/~eriberto/ FakeWatchNoUpstreamSiteForThisPackage-(\d\S+)\.gz --- mp3rename-0.6.orig/mp3rename.c +++ mp3rename-0.6/mp3rename.c @@ -20,12 +20,13 @@ void display_help(); void buildtag(char *buf, char *title, char *artist, char *album, char *year, char *comment, char *genre); void set_filename(int argc,char *argv[]); +void rtrim(char* astring); int main(int argc, char *argv[]) { FILE *fp; - int verbose = 0, forced = 0, burn = 0, info = 0, all = 0; - unsigned char sig[2]; + int verbose = 0, forced = 0, burn = 0, info = 0, all = 0, padtrack = 0; + unsigned char sig[3]; char genre[1]; char input_char; int i=0,plaatsen = 0; @@ -36,7 +37,8 @@ if (argc < 2 ) /* If nothing is given */ { - fprintf(stderr,"Mp3rename\n\nusage: [-vfhsbia] [file ...]\n\n"); + fprintf(stderr,"Mp3rename\n\nusage: [-vfhsbia] [file ...]\n\nUse 'mp3rename -h' for a usage summary\n\n"); + return 0; } @@ -66,8 +68,11 @@ case 'a': /* Ask everything */ all = 1; break; + case 'p': + padtrack = 1; + break; default: /* If wrong option is given */ - fprintf(stderr,"Mp3rename\n\nusage: [-vfh] [file ...]\n\n"); + fprintf(stderr,"Mp3rename\n\nusage: [-vfhsbia] [file ...]\n\nUse 'mp3rename -h' for a usage summary\n\n"); exit(1); } argv += optind; @@ -91,7 +96,7 @@ strcat(filenamelook,".mp3"); /* add .mp3 so that the filename will be complete */ do { - char title[31]="", artist[31]="", album[31]="", year[5]="", comment[31]="", fbuf[4], newfilename[160]="",nieuw[150]="",dir[150]="",dirsource[200],fullline[228]="", burnname[29]=""; + char title[31]="", artist[31]="", album[31]="", year[5]="", comment[31]="", fbuf[4], newfilename[160]="",nieuw[150]="",dir[150]="",dirsource[200],fullline[228]="", burnname[29]="", track; plaatsen = 0; if ( !( fp=fopen(*argv,"rb+") ) ) /* If the file doesn exist */ @@ -104,6 +109,8 @@ /* Lets check if we have a real mp3 file */ fread(sig,sizeof(sig),1,fp); + /* ID3v2 */ + if(sig[0]!='I' || sig[1]!='D' || sig[2]!='3'){ sig[0] &= 0xff; sig[1] &= 0xf0; if(!((sig[0] == 0xff) && (sig[1] == 0xf0))) @@ -112,7 +119,8 @@ fclose(fp); ++argv; continue; - } + } + } /* Lets go to the beginning of the tag */ if ( fseek(fp, -128, SEEK_END )) @@ -131,7 +139,14 @@ fread(artist,1,30,fp); artist[30] = '\0'; fread(album,1,30,fp); album[30] = '\0'; fread(year,1,4,fp); year[4] = '\0'; - fread(comment,1,30,fp); comment[30] = '\0'; + fread(comment,1,30,fp); + if (comment[28] == '\0' && comment[29] != '\0') { + /* ID3v1.1 - specify track number in the last byte of comment field*/ + track = comment[29]; + } + else + { track = 0; } + comment[30] = '\0'; fread(genre,1,1,fp); fseek(fp, -128, SEEK_END); /* back to the beginning of the tag */ } @@ -290,6 +305,17 @@ { printf("Artist : %s\n",artist); printf("Title : %s\n",title); + if(track!='\0') + { + if(track < 10 && padtrack == 1) + { + printf("Track : 0%i\n",track); + } + else + { + printf("Track : %i\n",track); + } + } printf("Album : %s\n",album); printf("Year : %s\n\n",year); ++argv; @@ -297,31 +323,10 @@ } /* Remove trailing spaces */ - i=strlen(artist)-1; - while (i && artist[i]==' ') - { - artist[i]='\0'; - i--; - } - - i=strlen(title)-1; - while (i && title[i]==' ') - { - title[i]='\0'; - i--; - } - i=strlen(album)-1; - while (i && album[i]==' ') - { - album[i]='\0'; - i--; - } - i=strlen(year)-1; - while (i && year[i]==' ') - { - year[i]='\0'; - i--; - } + rtrim((char*)&artist); + rtrim((char*)&title); + rtrim((char*)&album); + rtrim((char*)&year); /* We go through the filenamelook until we find a &x combination then we replace the &x with album/title/year/artis */ @@ -352,6 +357,18 @@ strcpy(newfilename,tmp); i++; break; + case 'k': + if(track < 10 && padtrack == 1) + { + sprintf(tmp,"%s0%d",newfilename,track); + } + else + { + sprintf(tmp,"%s%d",newfilename,track); + } + strcpy(newfilename,tmp); + i++; + break; default: printf("Illegal char in config file please use the option '-s help' for more information\n"); exit(1); @@ -383,9 +400,11 @@ /* Build the new tag from the new names */ - buildtag(fullline,title,artist,album,year,comment,genre); - fwrite(fullline,1,128,fp); - + if ((forced) || (all)) + { + buildtag(fullline,title,artist,album,year,comment,genre); + fwrite(fullline,1,128,fp); + } fclose(fp); /* Lets catch illegal characters */ @@ -436,6 +455,17 @@ return 0; } +void rtrim(char* astring){ + int i; + + i=strlen(astring)-1; + while (i && astring[i]==' ') + { + astring[i]='\0'; + i--; + } +} + void buildtag(char *buf, char *title, char *artist, char *album, char *year, char *comment, char *genre) { @@ -448,7 +478,7 @@ strncat(buf,album,30); pad(year,4); strncat(buf,year,4); - pad(comment,30); + pad(comment,30); strncat(buf,comment,30); strncat(buf,genre,1); } @@ -476,6 +506,7 @@ printf("\t-h\t Display this help message.\n"); printf("\t-b\t Limit the file size to 32 chars.\n"); printf("\t-i\t Only show the id3tags.\n"); + printf("\t-p\t Pad the track number with a leading zero when less than 10.\n"); printf("\t-a\t Ask everything for the id3tag.\n\n"); printf("\t-s\t Set the default filename look.\n"); printf("\t \t for more help on this option: -s help\n\n"); @@ -500,7 +531,7 @@ printf("Mp3rename 0.6\n\n"); printf(" Use this option to set the default look of the file\n"); printf(" The information is saved in ~/.mp3rename\n"); - printf(" You can use &t title, &b album, &y year and &a artist\n\n"); + printf(" You can use &t title, &b album, &y year, &k track and &a artist\n\n"); printf(" Example : mp3rename -s '(&a)-&t-&b'\n"); printf(" for (artist)-title-album.mp3\n\n"); return;