@@ -120,14 +120,10 @@ def run(self):
120120'-lmapnik-json' ,
121121] + ['-l%s' % i for i in get_boost_library_names ()])
122122
123- # Dynamically make the mapnik/paths.py file if it doesn't exist.
124- if os .path .isfile ('mapnik/paths.py' ):
125- create_paths = False
126- else :
127- create_paths = True
128- f_paths = open ('mapnik/paths.py' , 'w' )
129- f_paths .write ('import os\n ' )
130- f_paths .write ('\n ' )
123+ # Dynamically make the mapnik/paths.py file
124+ f_paths = open ('mapnik/paths.py' , 'w' )
125+ f_paths .write ('import os\n ' )
126+ f_paths .write ('\n ' )
131127
132128input_plugin_path = check_output ([mapnik_config , '--input-plugins' ])
133129font_path = check_output ([mapnik_config , '--fonts' ])
@@ -147,30 +143,32 @@ def run(self):
147143 input_plugin_files = os .listdir (input_plugin_path )
148144 input_plugin_files = [os .path .join (
149145 input_plugin_path , f ) for f in input_plugin_files ]
150- if not os .path .exists (os .path .join ('mapnik' , 'plugins ' , 'input' )):
151- os .makedirs (os .path .join ('mapnik' , 'plugins ' , 'input' ))
146+ if not os .path .exists (os .path .join ('mapnik' , 'lib' , 'mapnik ' , 'input' )):
147+ os .makedirs (os .path .join ('mapnik' , 'lib' , 'mapnik ' , 'input' ))
152148 for f in input_plugin_files :
153149 try :
154150 shutil .copyfile (f , os .path .join (
155- 'mapnik' , 'plugins ' , 'input' , os .path .basename (f )))
151+ 'mapnik' , 'lib' , 'mapnik ' , 'input' , os .path .basename (f )))
156152 except shutil .Error :
157153 pass
158154 font_files = os .listdir (font_path )
159155 font_files = [os .path .join (font_path , f ) for f in font_files ]
160- if not os .path .exists (os .path .join ('mapnik' , 'plugins ' , 'fonts' )):
161- os .makedirs (os .path .join ('mapnik' , 'plugins ' , 'fonts' ))
156+ if not os .path .exists (os .path .join ('mapnik' , 'lib' , 'mapnik ' , 'fonts' )):
157+ os .makedirs (os .path .join ('mapnik' , 'lib' , 'mapnik ' , 'fonts' ))
162158 for f in font_files :
163159 try :
164160 shutil .copyfile (f , os .path .join (
165- 'mapnik' , 'plugins ' , 'fonts' , os .path .basename (f )))
161+ 'mapnik' , 'lib' , 'mapnik ' , 'fonts' , os .path .basename (f )))
166162 except shutil .Error :
167163 pass
168- if create_paths :
169- f_paths .write (
170- 'mapniklibpath = os.path.join(os.path.dirname(os.path.realpath(__file__)), "plugins")\n ' )
171- f_paths .write ("inputpluginspath = os.path.join(mapniklibpath,'input')\n " )
172- f_paths .write ("fontscollectionpath = os.path.join(mapniklibpath,'fonts')\n " )
173- elif create_paths :
164+ f_paths .write (
165+ 'mapniklibpath = os.path.join(os.path.dirname(os.path.realpath(__file__)), "lib")\n ' )
166+ f_paths .write ("inputpluginspath = os.path.join(mapniklibpath, 'mapnik', 'input')\n " )
167+ f_paths .write ("fontscollectionpath = os.path.join(mapniklibpath, 'mapnik', 'fonts')\n " )
168+ f_paths .write (
169+ "__all__ = [mapniklibpath,inputpluginspath,fontscollectionpath]\n " )
170+ f_paths .close ()
171+ else :
174172 if os .environ .get ('LIB_DIR_NAME' ):
175173 mapnik_lib_path = lib_path + os .environ .get ('LIB_DIR_NAME' )
176174 else :
@@ -181,8 +179,6 @@ def run(self):
181179 "inputpluginspath = '{path}'\n " .format (path = input_plugin_path ))
182180 f_paths .write (
183181 "fontscollectionpath = '{path}'\n " .format (path = font_path ))
184-
185- if create_paths :
186182 f_paths .write (
187183 "__all__ = [mapniklibpath,inputpluginspath,fontscollectionpath]\n " )
188184 f_paths .close ()
@@ -269,7 +265,7 @@ def run(self):
269265 'nose' ,
270266 ],
271267 package_data = {
272- 'mapnik' : ['lib/*' , 'plugins /*/*' , 'share/*/*' ],
268+ 'mapnik' : ['lib/*.* ' , 'lib/* /*/*' , 'share/*/*' ],
273269 },
274270 test_suite = 'nose.collector' ,
275271 cmdclass = {
0 commit comments