Sure
Here's the spec file and the script.

Of to lectures
/Gabriel


On Mon, 2001-09-03 at 09:02, Martin Sevior wrote:
> 
> 
> On Fri, 31 Aug 2001, Tomas Frydrych wrote:
> 
> > their way through the Unix font mess. Certainly a set of font packs 
> > for the most common locales is, I think, an absolute must before ve 
> > release 1.0.
> 
> I agree. The best way to this is via rpm's. We should be able to make
> small modifications to Gabriel's ispell hash spec files to build these
> font packs.
> 
> Any volenteers?
> 
> Could you post your modified SPEC files to the list Gabriel?
> 
> Thanks
> 
> Martin
> 
> > 
> > Also the front page of the AW download site should contain clear 
> > notice that the standard font pack included with Unix version of AW 
> > is only suitable for iso8859-1, and a link to the location where 
> > additional font packs can be found. This should be done straight 
> > away, even without any font packs available at the moment; it will 
> > make it possible to put the packs up as we get them, and also 
> > warn people about the fact that there are locale specific issues with 
> > AW on Unix (also the download site should encourage people to 
> > contribute pack for locales not yet represented). Sam, would you 
> > have time to make these changes to the website?
> > 
> 
> I agree.
> 
> > It might also be worth considering to pop out a warning message 
> > box when AW is run under a locale other than iso-8859-1 and only 
> > the standard fonts are found. I have got the feeling that many 
> > ordinary users simple expect that since they have their Unix locale 
> > properly set up, AW will work out of the box, especially since they 
> > see all the menus localised into their language; well, that is 
> > nowhere near the reality.
> 
> This should be straight foward. We just have to determine the directory
> name from the users locale and see if a  the directory exists and contains
> fonts.
> 
> If not popup our standard popup message.
> 
> Martin
> 
> 
> 
> 
> 

%define name abispell-LOCALE_SHORTPLATFORM
%define version VERSION
%define release RELEASE
%define prefix /usr
%define ABIPREFIX %{prefix}/share

Name: %{name}
Summary: LOCALE(LOCALE_SHORT) dictionary.
Version: %{version}
Release: %{release}
Source: %{name}-%{version}.tar.gz
Group: Applications/Publishing
URL: http://www.abisource.com/
BuildRoot: /var/tmp/%{name}-%{version}-buildroot
Copyright: GPL
Prefix: %{prefix}
#Icon: 
Packager: Gabriel Gerhardsson <[EMAIL PROTECTED]>
Distribution: RedHat 7.x Contrib
# No requirements
#Requires: 


%description
LOCALE(LOCALE_SHORT) dictionary for use with AbiWord.



%prep
rm -rf $RPM_BUILD_DIR/%{name}-%{version}
mkdir $RPM_BUILD_DIR/%{name}-%{version}
cd %{name}-%{version}
tar zxvf $RPM_SOURCE_DIR/%{name}-%{version}.tar.gz


%build
#Nothing needs to be done


%install
# Copies all ispell dictionaries
mkdir -p $RPM_BUILD_ROOT%{ABIPREFIX}/AbiSuite/dictionary
cp $RPM_BUILD_DIR/%{name}-%{version}/* $RPM_BUILD_ROOT%{ABIPREFIX}/AbiSuite/dictionary/
# Remove duplicate Little* entry
/bin/rm -f $RPM_BUILD_ROOT%{ABIPREFIX}/AbiSuite/dictionary/Little*


%clean
rm -rf $RPM_BUILD_ROOT $RPM_BUILD_DIR/file.list.%{name} 
$RPM_BUILD_DIR/%{name}-%{version}


%files
%defattr(-,root,root)
%{ABIPREFIX}/AbiSuite/dictionary/*


%changelog
* Wed Aug 29 2001 Gabriel Gerhardsson
- Slimmed down %description.

* Tue Aug 28 2001 Gabriel Gerhardsson
- Changes packagename fron "abiword-dictionary" to "abispell".
- Readded all the different variants of packages (e.g. de-CH, de-DE, de-AT, etc)

* Mon Aug 27 2001 Gabriel Gerhardsson
- Changes in prepararation for script-usage. e.g. "macros" here and there.

* Mon Aug 27 2001 Gabriel Gerhardsson
- Cleaned up a bit.
- Stopped my previous tar-silliness.

* Mon Aug 27 2001 Gabriel Gerhardsson
- Initial experimentation
#!/usr/bin/perl

#
# Coded by Gabriel Gerhardsson, 2001
#

$RPM_BUILD_DIR = "/usr/src/redhat/BUILD";
$RPM_SOURCE_DIR = "/usr/src/redhat/SOURCES";
$RPM_SPEC_DIR = "/usr/src/redhat/SPECS";

$FN_PREFIX = "abispell";
$FN_SPEC = "-general";
$FN_PLATFORM = "";
$FN_VERSION = "0.0.1";
$FN_RELEASE = "7";


@dict =         ("catala.hash", "czech.hash", "dansk.hash", "deutsch.hash", 
"deutsch.hash", "deutsch.hash", "ellhnika.hash", "british.hash", "british.hash", 
"british.hash", "british.hash", "british.hash", "american.hash", "british.hash", 
"esperanto.hash", "espanol.hash", "francais.hash", "francais.hash", "francais.hash", 
"francais.hash", "irish.hash", "italian.hash", "lietuviu.hash", "nederlands.hash", 
"norsk.hash", "nynorsk.hash",     "polish.hash", "portugues.hash", "portugues.hash", 
"russian.hash", "svenska.hash");
@includeEnc =   (0,             0,              0,              0,              0,     
         0,              0,              0,              0,              0,            
  0,              0,              0,              0,              0,                   
   0,              0,              0,              0,              0,              0,  
            0,              1,              0,              0,              0,         
             0,              0,              0,              0,              0);
@acr =          ("ca-ES",       "cs-CZ",        "da-DK",        "de-CH",        
"de-DE",        "de-AT",        "el-GR",        "en-AU",        "en-CA",        
"en-GB",        "en-IE",        "en-NZ",        "en-US",        "en-ZA",        "eo",  
                 "es-ES",        "fr-BE",        "fr-CA",        "fr-CH",        
"fr-FR",        "ga-IE",        "it-IT",        "lt-LT",        "nl-NL",        
"nb-NO",        "nn-NO",                "pl-PL",        "pt-PT",        "pt-BR",       
 "ru-RU",        "sv-SE");
@name =         ("Catalan",     "Czech",        "Danish",       "German",       
"German",       "German",       "Greek",        "English",      "English",      
"English",      "English",      "English",      "English",      "English",      
"Esperanto",            "Spanish",      "Frensh",       "Frensh",       "Frensh",      
 "Frensh",       "Irish gaelic", "Italian",      "Latvian",      "Dutch",        
"Norwegian",    "Norwegian(nynorsk)",   "Polish",       "Portuguese",   "Portuguese",  
 "Russian",      "Swedish");

        
for ($i = 0; $i < @dict; $i++) {
        $full_name = "${FN_PREFIX}-$acr[$i]${FN_PLATFORM}-${FN_VERSION}";
        print "--- Building: $name[$i]($acr[$i]) ---\n";

        if ($includeEnc[$i]) {
                `cd dictionaries; tar zcvf ${RPM_SOURCE_DIR}/${full_name}.tar.gz 
$dict[$i] $dict[$i]-encoding`;
        } else {
                `cd dictionaries; tar zcvf ${RPM_SOURCE_DIR}/${full_name}.tar.gz 
$dict[$i]`;
        }
                
        `cp ${FN_PREFIX}${FN_SPEC}-${FN_VERSION}-${FN_RELEASE}.spec 
${RPM_SPEC_DIR}/${full_name}.spec`;
                
        `perl -pi -e 's/LOCALE_SHORT/$acr[$i]/g' ${RPM_SPEC_DIR}/${full_name}.spec`;
        `perl -pi -e 's/LOCALE/$name[$i]/g' ${RPM_SPEC_DIR}/${full_name}.spec`;
        `perl -pi -e 's/VERSION/${FN_VERSION}/g' ${RPM_SPEC_DIR}/${full_name}.spec`;
        `perl -pi -e 's/RELEASE/${FN_RELEASE}/g' ${RPM_SPEC_DIR}/${full_name}.spec`;
        `perl -pi -e 's/PLATFORM/${FN_PLATFORM}/g' ${RPM_SPEC_DIR}/${full_name}.spec`;


        `cd ${RPM_SPEC_DIR}; rpm -bb --target=i386 ${full_name}.spec`;

        # Try this instead for compatibility-mode on rpm >= 4.0.3(?) (Creates rpms 
compatible with rpm3). Thou be warned! This has not been tested and is not guaranteed 
to work!
        # `cd ${RPM_SPEC_DIR}; rpm -bb --target=i386 --define '_noPayloadPrefix 1' 
--nodirtokens ${full_name}.spec`;


        `rm -f ${RPM_SPEC_DIR}/${full_name}.spec`;
        `rm -f ${RPM_SOURCE_DIR}/${full_name}.tar.gz`;
}

print "\n--- All done!\n";

Reply via email to