title: podspec flatten directories and imports fail
body: <p>I'm using cocoapods 1.2.1</p>
  
  <p>I made this podspec:</p>
  
  <pre><code>Pod::Spec.new do |s|
  
    s.name         = "SignalLib"
    s.version      = "2.3.1"
    s.summary      = "Signal Protocol Pod."
    s.description  = &lt;&lt;-DESC
                     This allows an iOS project to retrieve and configure the Signal C implementation
                     https://github.com/WhisperSystems/libsignal-protocol-c
                     DESC
  
    s.homepage     = "http://www.pangea.com"
    s.license      = { :type =&gt; 'GPLv3', :text =&gt; &lt;&lt;-LICENSE
                  Copyright 2015-2016 Open Whisper Systems
                  Licensed under the GPLv3: http://www.gnu.org/licenses/gpl-3.0.html
                  Additional Permissions For Submission to Apple App Store: Provided that you are otherwise in compliance with the GPLv3 for each covered work you convey (including without limitation making the Corresponding Source available in compliance with Section 6 of the GPLv3), Open Whisper Systems also grants you the additional permission to convey through the Apple App Store non-source executable versions of the Program as incorporated into each applicable covered work as Executable Versions only under the Mozilla Public License version 2.0 (https://www.mozilla.org/en-US/MPL/2.0/).
                  LICENSE
                 }
    s.author             = { "XXX" =&gt; "XXX@XXX.com" }
    s.osx.deployment_target = '10.9'
    s.ios.deployment_target = '8.0'
  
    s.source       = { :git =&gt; "https://github.com/WhisperSystems/libsignal-protocol-c.git", 
                       :tag =&gt; 'v' + s.version.to_s}
  
    s.header_mappings_dir = 'src'
    s.source_files  = ["src/**/*.{h,c}"]
    s.exclude_files = 'src/curve25519/ed25519/main'
    s.public_header_files = ["src/signal_protocol.h", "src/signal_protocol_internal.h", "src/LocalStorageProtocol.pb-c.h", "src/signal_protocol_types.h", "src/curve.h", "src/hkdf.h", "src/ratchet.h", "src/protocol.h", "src/session_state.h", "src/session_record.h", "src/session_pre_key.h", "src/session_builder.h", "src/session_cipher.h", "src/key_helper.h", "src/sender_key.h", "src/sender_key_state.h", "src/sender_key_record.h", "src/group_session_builder.h", "src/group_cipher.h", "src/fingerprint.h"]
    s.xcconfig = { 'HEADER_SEARCH_PATHS' =&gt; '$(PODS_ROOT)/SignalLib/src $(PODS_ROOT)/SignalLib/src/curve25519 $(PODS_ROOT)/SignalLib/src/curve25519/ed25519', 'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' =&gt; 'YES' }
    #s.preserve_paths = 'src'
  
    s.subspec 'protobuf-c' do |ss|
      ss.source_files = 'src/protobuf-c/protobuf-c.h', 'src/protobuf-c'
      ss.public_header_files = 'src/protobuf-c/protobuf-c.h'
      #ss.preserve_paths = 'src/protobuf-c'
      ss.xcconfig = { 'HEADER_SEARCH_PATHS' =&gt; '$(PODS_ROOT)/SignalLib/src/protobuf-c' }
      #ss.frameworks = 'frameworks'
    end
  end
  </code></pre>
  
  <p>This ALMOST works but in some files there is a:</p>
  
  <pre><code>#import &lt;protobuf-c/protobuf-c.h&gt;
  </code></pre>
  
  <p>And that fails when Xcode tries to compile it.
  The reason is that even if I make a subspec supposed to include the file protobuf-c.h , the file is not in the subspec folder.</p>
  
  <p>I tried using </p>
  
  <pre><code>s.header_mappings_dir = 'src'
  </code></pre>
  
  <p>But that also fails. It's actually even worse because the s.public_header_files doesn't even work anymore and only my umbrella header is included as public.</p>